diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..219e0cb --- /dev/null +++ b/.editorconfig @@ -0,0 +1,267 @@ +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# All files +[*] +insert_final_newline = true + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +end_of_line = crlf + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false +dotnet_style_qualification_for_property = false + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:error +dotnet_style_predefined_type_for_member_access = true:error + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_style_coalesce_expression = true:error +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true:error +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true:error +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:error +dotnet_style_prefer_compound_assignment = true:error +dotnet_style_prefer_conditional_expression_over_assignment = true:error +dotnet_style_prefer_conditional_expression_over_return = true:error +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true:error +dotnet_style_prefer_inferred_tuple_names = true:error +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true:error + +# Parameter preferences +dotnet_code_quality_unused_parameters = all:error + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = false:warning +dotnet_style_allow_statement_immediately_after_block_experimental = false:error + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_accessors = when_on_single_line:error +csharp_style_expression_bodied_constructors = when_on_single_line:error +csharp_style_expression_bodied_indexers = when_on_single_line:error +csharp_style_expression_bodied_lambdas = true:error +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = when_on_single_line:error +csharp_style_expression_bodied_operators = when_on_single_line:error +csharp_style_expression_bodied_properties = when_on_single_line:error + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:error +csharp_style_pattern_matching_over_is_with_cast_check = true:error +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_not_pattern = true:error +csharp_style_prefer_pattern_matching = true:error +csharp_style_prefer_switch_expression = true:error + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:error + +# Modifier preferences +csharp_prefer_static_local_function = true:error +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async +csharp_style_prefer_readonly_struct = true:error +csharp_style_prefer_readonly_struct_member = true:suggestion + +# Code-block preferences +csharp_prefer_braces = true:error +csharp_prefer_simple_using_statement = true:error +csharp_style_namespace_declarations = file_scoped:error +csharp_style_prefer_method_group_conversion = true:error +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_prefer_top_level_statements = true:silent + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:error +csharp_style_deconstructed_variable_declaration = true:error +csharp_style_implicit_object_creation_when_type_is_apparent = true:error +csharp_style_inlined_variable_declaration = true:error +csharp_style_prefer_index_operator = true:warning +csharp_style_prefer_local_over_anonymous_function = true:warning +csharp_style_prefer_null_check_over_type_check = true:error +csharp_style_prefer_range_operator = true:warning +csharp_style_prefer_tuple_swap = true:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_throw_expression = true:error +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false:error +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:error +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:error +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:error +csharp_style_allow_embedded_statements_on_same_line_experimental = false:error + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +# Analyzer Errors + +dotnet_diagnostic.AD0001.severity = none + +[*.{cs,vb}] +dotnet_style_coalesce_expression = true:error +dotnet_style_null_propagation = true:error +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error +dotnet_style_prefer_auto_properties = true:error +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_return = true:suggestion +dotnet_style_explicit_tuple_names = true:error +dotnet_style_prefer_inferred_tuple_names = true:error +dotnet_style_prefer_inferred_anonymous_type_member_names = true:error +dotnet_style_prefer_compound_assignment = true:error +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +indent_size = 4 +end_of_line = crlf +dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_event = false:silent + +[*.{yml,yaml}] +trim_trailing_whitespace = true diff --git a/.filenesting.json b/.filenesting.json new file mode 100644 index 0000000..0b71966 --- /dev/null +++ b/.filenesting.json @@ -0,0 +1,3 @@ +{ + "help":"https://go.microsoft.com/fwlink/?linkid=866610" +} \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..81c7b58 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: 'bug' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..36014cd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: 'enhancement' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..bf1a861 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,70 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +registries: + ghcr-nuget: + type: nuget-feed + url: https://nuget.pkg.github.com/InfinityFlowApp/index.json + username: ${{secrets.GHCR_DEPENDABOT_PACKAGE_SECERET_USERNAME }} + password: ${{secrets.GHCR_DEPENDABOT_PACKAGE_SECERET_KEY}} +updates: + - package-ecosystem: "nuget" # See documentation for possible values + directory: "/" # Location of package manifests + registries: + - ghcr-nuget + schedule: + interval: "daily" + labels: + - "dependencies" + open-pull-requests-limit: 10 + groups: + Temporal: + patterns: + - "Temporalio.*" + - Temporalio + Aspire: + patterns: + - "Aspire" + - "Aspire.*" + Kiota: + patterns: + - "Microsoft.Kiota*" + dotnet: + patterns: + - "Microsoft.*" + - "System.*" + exclude-patterns: + - "Microsoft.Orleans*" + - "Microsoft.Kiota*" + Orleans: + patterns: + - "Microsoft.Orleans.*" + - "OrleansContrib.*" + OpenTelemetry: + patterns: + - "OpenTelemetry.*" + MartenAndFriends: + patterns: + - "Marten" + - "WolverineFx" + - "Marten.*" + - "WolverineFx.*" + - "JasperFx.*" + - "Oakton.*" + - "Lamar.*" + + - package-ecosystem: "devcontainers" + directory: "/" # Location of package manifests + schedule: + interval: "daily" + labels: + - "dev-tooling" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + labels: + - "dev-tooling" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..273de22 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,73 @@ +name-template: "InfinityFlow System $RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" +change-template: "- $TITLE by @$AUTHOR (#$NUMBER)" +no-changes-template: "- No changes" +categories: + - title: "πŸ“š Documentation" + labels: + - "documentation" + - title: "πŸš€ New Features" + labels: + - "enhancement" + - title: "πŸ› Bug Fixes" + labels: + - "bug" + - title: "🚒 area-resources" + labels: + - "area-resources" + - title: "🀝 area-shared" + labels: + - "area-shared" + - title: "πŸ“½οΈ area-projects" + labels: + - "area-projects" + - title: "🧰 Maintenance & Dependencies" + labels: + - "maintenance" + - "dependencies" + - title: "☸️ Deployment Resources" + labels: + - "deployment-resources" + - title: "πŸ§‘πŸΌβ€πŸ’» Development Tooling" + labels: + - "dev-tooling" +version-resolver: + major: + labels: + - "major" + minor: + labels: + - "minor" + patch: + labels: + - "patch" + default: patch +template: | + $CHANGES + + ## πŸ‘¨πŸΌβ€πŸ’» Contributors + + $CONTRIBUTORS +autolabeler: + - label: "documentation" + files: + - "docs/**/*" + - label: "dev-tooling" + files: + - ".devcontainer/**/*" + - "eng/**/*" + - label: "maintenance" + files: + - ".github/**/*" + - "test/**/*" + - label: "area-resources" + files: + - "src/Domain/InfinityFlow.Domain.Resources/**/*" + - label: "area-shared" + files: + - "src/InfinityFlow.Shared/**/*" + - "src/InfinityFlow.Shared.Temporal/**/*" + - label: "dependencies" + files: + - "Directory.Packages.props" + - "**NuGet.config" diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml new file mode 100644 index 0000000..efd4db8 --- /dev/null +++ b/.github/workflows/build-test-package.yml @@ -0,0 +1,51 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Build & Release & Test & Publish + +on: + pull_request: {} + push: + branches: + - main + release: + types: + - published + workflow_dispatch: {} + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json + env: + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --configuration Release --no-build --verbosity normal + - name: Pack + run: dotnet pack --configuration Release --no-build --output pack/ + - name: Store .NET Package + uses: actions/upload-artifact@v4 + with: + name: nuget + if-no-files-found: error + retention-days: 7 + path: pack/*.nupkg + - name: Publish .NET Solution to GitHub Packages + continue-on-error: true + run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }} diff --git a/.github/workflows/releasedrafter.yml b/.github/workflows/releasedrafter.yml new file mode 100644 index 0000000..a2971cc --- /dev/null +++ b/.github/workflows/releasedrafter.yml @@ -0,0 +1,25 @@ +name: Release Drafter + +on: + push: + branches: + - main + pull_request_target: + types: + - edited + - opened + - reopened + - synchronize + workflow_dispatch: + +jobs: + update_release_draft: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: "Draft Release" + uses: release-drafter/release-drafter@v6.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16bd511 --- /dev/null +++ b/.gitignore @@ -0,0 +1,379 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# Allow the directory for Release Resource + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +appsettings.Development.json + +# JetBrains +.idea/ + +# C# vscode extension +.mono/ +src/InfinityFlow.Hosting.WebAPI/appsettings.Development.json +src/InfinityFlow.AppHost/postgres-data + +kustomize/overlays/dev/charts +kustomize/overlays/staging/charts +kustomize/overlays/prod/charts diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..6fc0535 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,18 @@ +{ + "recommendations": [ + "github.copilot", + "github.copilot-chat", + "github.copilot-labs", + "github.vscode-pull-request-github", + "eamodio.gitlens", + "github.vscode-github-actions", + "ms-azuretools.vscode-docker", + "bpruitt-goddard.mermaid-markdown-syntax-highlighting", + "bierner.markdown-mermaid", + "streetsidesoftware.code-spell-checker", + "ms-dotnettools.vscode-dotnet-pack", + "editorconfig.editorconfig", + "ms-dotnettools.vscodeintellicode-csharp", + "kie-group.swf-vscode-extension" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..487c451 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "C#: Aspire Debug", + "type": "dotnet", + "request": "launch", + "projectPath": "${workspaceFolder}/src/InfinityFlow.AppHost/InfinityFlow.AppHost.csproj", + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + } + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..66f058f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/PlatformCore.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/PlatformCore.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/PlatformCore.sln" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..135e274 --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +extends: default + +rules: + document-start: + present: false + line-length: disable + comments: + min-spaces-from-content: 1 # Adjust the number of spaces here + truthy: disable + diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..786d002 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,33 @@ + + + + net9.0 + enable + true + enable + + + $([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('.gitignore', + '$(MSBuildThisFileDirectory)')))) + + + $(NoWarn);AD0001 + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..42b6949 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,33 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GitVersion.yaml b/GitVersion.yaml new file mode 100644 index 0000000..6a98484 --- /dev/null +++ b/GitVersion.yaml @@ -0,0 +1,6 @@ +mode: ContinuousDeployment +branches: + main: + label: rc + pull-request: + label: pr diff --git a/InfinityFlow.DigitalOcean.Client.sln b/InfinityFlow.DigitalOcean.Client.sln new file mode 100644 index 0000000..9545c9f --- /dev/null +++ b/InfinityFlow.DigitalOcean.Client.sln @@ -0,0 +1,55 @@ +ο»Ώ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34024.191 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{42FEE79F-2B8D-49C0-9555-58741EE26DAC}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .filenesting.json = .filenesting.json + .gitattributes = .gitattributes + .gitignore = .gitignore + .gitmodules = .gitmodules + .yamllint = .yamllint + cspell.config.yaml = cspell.config.yaml + Directory.Build.props = Directory.Build.props + Directory.Packages.props = Directory.Packages.props + NuGet.config = NuGet.config + README.md = README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CE85C576-291A-449B-B775-5A1AF397AB14}" + ProjectSection(SolutionItems) = preProject + src\Directory.Build.props = src\Directory.Build.props + Vogen.cs = Vogen.cs + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0A4807C8-12F6-44BA-A611-6EDC89610613}" + ProjectSection(SolutionItems) = preProject + test\Directory.Build.props = test\Directory.Build.props + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InfinityFlow.DigitalOcean.Client", "src\InfinityFlow.DigitalOcean.Client\InfinityFlow.DigitalOcean.Client.csproj", "{21CC94C8-6EDE-566C-AE69-39B698C41A74}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {21CC94C8-6EDE-566C-AE69-39B698C41A74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {21CC94C8-6EDE-566C-AE69-39B698C41A74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {21CC94C8-6EDE-566C-AE69-39B698C41A74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {21CC94C8-6EDE-566C-AE69-39B698C41A74}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {CE85C576-291A-449B-B775-5A1AF397AB14} = {42FEE79F-2B8D-49C0-9555-58741EE26DAC} + {0A4807C8-12F6-44BA-A611-6EDC89610613} = {42FEE79F-2B8D-49C0-9555-58741EE26DAC} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {62B16938-8F97-4582-81CD-4AB2720FD729} + EndGlobalSection +EndGlobal diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 0000000..8af8160 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,25 @@ +ο»Ώ + + + + + + + + + + + + + + + + + + + + diff --git a/cspell.config.yaml b/cspell.config.yaml new file mode 100644 index 0000000..f6c5f5c --- /dev/null +++ b/cspell.config.yaml @@ -0,0 +1,17 @@ +version: "0.2" +ignorePaths: [] +dictionaryDefinitions: [] +dictionaries: [] +words: + - ASPNETCORE + - Cooldown + - infinityflow + - Npgsql + - Oakton + - OTEL + - OTLP + - Keycloak + - Temporal +ignoreWords: + - openid +import: [] diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..6c33df0 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + + <_Parameter1>$(AssemblyName).Tests + + + diff --git a/src/InfinityFlow.DigitalOcean.Client/DigitalOceanClient.cs b/src/InfinityFlow.DigitalOcean.Client/DigitalOceanClient.cs new file mode 100644 index 0000000..2b1ac78 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/DigitalOceanClient.cs @@ -0,0 +1,48 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Serialization.Form; +using Microsoft.Kiota.Serialization.Json; +using Microsoft.Kiota.Serialization.Multipart; +using Microsoft.Kiota.Serialization.Text; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client +{ + /// + /// The main entry point of the SDK, exposes the configuration and the fluent API. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DigitalOceanClient : BaseRequestBuilder + { + /// The v2 property + public global::InfinityFlow.DigitalOcean.Client.V2.V2RequestBuilder V2 + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.V2RequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// The request adapter to use to execute the requests. + public DigitalOceanClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary()) + { + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) + { + RequestAdapter.BaseUrl = "https://api.digitalocean.com"; + } + PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/InfinityFlow.DigitalOcean.Client.csproj b/src/InfinityFlow.DigitalOcean.Client/InfinityFlow.DigitalOcean.Client.csproj new file mode 100644 index 0000000..e33b82e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/InfinityFlow.DigitalOcean.Client.csproj @@ -0,0 +1,22 @@ +ο»Ώ + + + net9.0 + enable + enable + 618 + + + + + + + + + + + + + + + diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Account.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Account.cs new file mode 100644 index 0000000..54f62e4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Account.cs @@ -0,0 +1,122 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Account : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The total number of Droplets current user or team may have active at one time. + public int? DropletLimit { get; set; } + /// The email address used by the current user to register for DigitalOcean. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Email { get; set; } +#nullable restore +#else + public string Email { get; set; } +#endif + /// If true, the user has verified their account via email. False otherwise. + public bool? EmailVerified { get; set; } + /// The total number of Floating IPs the current user or team may have. + public int? FloatingIpLimit { get; set; } + /// The display name for the current user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// This value is one of "active", "warning" or "locked". + public global::InfinityFlow.DigitalOcean.Client.Models.Account_status? Status { get; set; } + /// A human-readable message giving more details about the status of the account. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? StatusMessage { get; set; } +#nullable restore +#else + public string StatusMessage { get; set; } +#endif + /// When authorized in a team context, includes information about the current team. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Account_team? Team { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Account_team Team { get; set; } +#endif + /// The unique universal identifier for the current user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uuid { get; set; } +#nullable restore +#else + public string Uuid { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Account() + { + AdditionalData = new Dictionary(); + Status = global::InfinityFlow.DigitalOcean.Client.Models.Account_status.Active; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Account CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Account(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_limit", n => { DropletLimit = n.GetIntValue(); } }, + { "email", n => { Email = n.GetStringValue(); } }, + { "email_verified", n => { EmailVerified = n.GetBoolValue(); } }, + { "floating_ip_limit", n => { FloatingIpLimit = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "status_message", n => { StatusMessage = n.GetStringValue(); } }, + { "team", n => { Team = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Account_team.CreateFromDiscriminatorValue); } }, + { "uuid", n => { Uuid = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("droplet_limit", DropletLimit); + writer.WriteStringValue("email", Email); + writer.WriteBoolValue("email_verified", EmailVerified); + writer.WriteIntValue("floating_ip_limit", FloatingIpLimit); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("status", Status); + writer.WriteStringValue("status_message", StatusMessage); + writer.WriteObjectValue("team", Team); + writer.WriteStringValue("uuid", Uuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Account_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Account_status.cs new file mode 100644 index 0000000..14b60b0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Account_status.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// This value is one of "active", "warning" or "locked". + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Account_status + { + [EnumMember(Value = "active")] + #pragma warning disable CS1591 + Active, + #pragma warning restore CS1591 + [EnumMember(Value = "warning")] + #pragma warning disable CS1591 + Warning, + #pragma warning restore CS1591 + [EnumMember(Value = "locked")] + #pragma warning disable CS1591 + Locked, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Account_team.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Account_team.cs new file mode 100644 index 0000000..82ef0ee --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Account_team.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// When authorized in a team context, includes information about the current team. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Account_team : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name for the current team. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The unique universal identifier for the current team. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uuid { get; set; } +#nullable restore +#else + public string Uuid { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Account_team() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Account_team CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Account_team(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "uuid", n => { Uuid = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("uuid", Uuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/ActionObject.cs b/src/InfinityFlow.DigitalOcean.Client/Models/ActionObject.cs new file mode 100644 index 0000000..cd841df --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/ActionObject.cs @@ -0,0 +1,116 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionObject : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the action was completed. + public DateTimeOffset? CompletedAt { get; set; } + /// A unique numeric ID that can be used to identify and reference an action. + public int? Id { get; set; } + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Region? Region { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Region Region { get; set; } +#endif + /// A human-readable string that is used as a unique identifier for each region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RegionSlug { get; set; } +#nullable restore +#else + public string RegionSlug { get; set; } +#endif + /// A unique identifier for the resource that the action is associated with. + public int? ResourceId { get; set; } + /// The type of resource that the action is associated with. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ResourceType { get; set; } +#nullable restore +#else + public string ResourceType { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the action was initiated. + public DateTimeOffset? StartedAt { get; set; } + /// The current status of the action. This can be "in-progress", "completed", or "errored". + public global::InfinityFlow.DigitalOcean.Client.Models.Action_status? Status { get; set; } + /// This is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ActionObject() + { + AdditionalData = new Dictionary(); + Status = global::InfinityFlow.DigitalOcean.Client.Models.Action_status.InProgress; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.ActionObject CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.ActionObject(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "completed_at", n => { CompletedAt = n.GetDateTimeOffsetValue(); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "region", n => { Region = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Region.CreateFromDiscriminatorValue); } }, + { "region_slug", n => { RegionSlug = n.GetStringValue(); } }, + { "resource_id", n => { ResourceId = n.GetIntValue(); } }, + { "resource_type", n => { ResourceType = n.GetStringValue(); } }, + { "started_at", n => { StartedAt = n.GetDateTimeOffsetValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("completed_at", CompletedAt); + writer.WriteIntValue("id", Id); + writer.WriteObjectValue("region", Region); + writer.WriteStringValue("region_slug", RegionSlug); + writer.WriteIntValue("resource_id", ResourceId); + writer.WriteStringValue("resource_type", ResourceType); + writer.WriteDateTimeOffsetValue("started_at", StartedAt); + writer.WriteEnumValue("status", Status); + writer.WriteStringValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Action_link.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Action_link.cs new file mode 100644 index 0000000..6906f63 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Action_link.cs @@ -0,0 +1,80 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The linked actions can be used to check the status of a Droplet's create event. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Action_link : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A URL that can be used to access the action. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Href { get; set; } +#nullable restore +#else + public string Href { get; set; } +#endif + /// A unique numeric ID that can be used to identify and reference an action. + public int? Id { get; set; } + /// A string specifying the type of the related action. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Rel { get; set; } +#nullable restore +#else + public string Rel { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Action_link() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Action_link CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Action_link(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "href", n => { Href = n.GetStringValue(); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "rel", n => { Rel = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("href", Href); + writer.WriteIntValue("id", Id); + writer.WriteStringValue("rel", Rel); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Action_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Action_status.cs new file mode 100644 index 0000000..35289d5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Action_status.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The current status of the action. This can be "in-progress", "completed", or "errored". + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Action_status + { + [EnumMember(Value = "in-progress")] + #pragma warning disable CS1591 + InProgress, + #pragma warning restore CS1591 + [EnumMember(Value = "completed")] + #pragma warning disable CS1591 + Completed, + #pragma warning restore CS1591 + [EnumMember(Value = "errored")] + #pragma warning disable CS1591 + Errored, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert.cs new file mode 100644 index 0000000..857de98 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert.cs @@ -0,0 +1,94 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Alert : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The comparison operator used against the alert's threshold. + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_comparison? Comparison { get; set; } + /// A unique ID that can be used to identify and reference the alert. + public Guid? Id { get; private set; } + /// A human-friendly display name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The notification settings for a trigger alert. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Notification? Notifications { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Notification Notifications { get; set; } +#endif + /// Period of time the threshold must be exceeded to trigger the alert. + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_period? Period { get; set; } + /// The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type. + public int? Threshold { get; set; } + /// The type of alert. + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Alert() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Alert CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Alert(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "comparison", n => { Comparison = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "notifications", n => { Notifications = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Notification.CreateFromDiscriminatorValue); } }, + { "period", n => { Period = n.GetEnumValue(); } }, + { "threshold", n => { Threshold = n.GetIntValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("comparison", Comparison); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("notifications", Notifications); + writer.WriteEnumValue("period", Period); + writer.WriteIntValue("threshold", Threshold); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_comparison.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_comparison.cs new file mode 100644 index 0000000..e6c9fd4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_comparison.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The comparison operator used against the alert's threshold. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Alert_comparison + { + [EnumMember(Value = "greater_than")] + #pragma warning disable CS1591 + Greater_than, + #pragma warning restore CS1591 + [EnumMember(Value = "less_than")] + #pragma warning disable CS1591 + Less_than, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_period.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_period.cs new file mode 100644 index 0000000..b98c52e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_period.cs @@ -0,0 +1,39 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Period of time the threshold must be exceeded to trigger the alert. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Alert_period + { + [EnumMember(Value = "2m")] + #pragma warning disable CS1591 + Twom, + #pragma warning restore CS1591 + [EnumMember(Value = "3m")] + #pragma warning disable CS1591 + Threem, + #pragma warning restore CS1591 + [EnumMember(Value = "5m")] + #pragma warning disable CS1591 + Fivem, + #pragma warning restore CS1591 + [EnumMember(Value = "10m")] + #pragma warning disable CS1591 + OneZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "15m")] + #pragma warning disable CS1591 + OneFivem, + #pragma warning restore CS1591 + [EnumMember(Value = "30m")] + #pragma warning disable CS1591 + ThreeZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "1h")] + #pragma warning disable CS1591 + Oneh, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy.cs new file mode 100644 index 0000000..d5410c0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy.cs @@ -0,0 +1,125 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Alert_policy : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alerts property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alerts? Alerts { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alerts Alerts { get; set; } +#endif + /// The compare property + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_compare? Compare { get; set; } + /// The description property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The enabled property + public bool? Enabled { get; set; } + /// The entities property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Entities { get; set; } +#nullable restore +#else + public List Entities { get; set; } +#endif + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// The type property + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_type? Type { get; set; } + /// The uuid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uuid { get; set; } +#nullable restore +#else + public string Uuid { get; set; } +#endif + /// The value property + public float? Value { get; set; } + /// The window property + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_window? Window { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Alert_policy() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alerts", n => { Alerts = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alerts.CreateFromDiscriminatorValue); } }, + { "compare", n => { Compare = n.GetEnumValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "enabled", n => { Enabled = n.GetBoolValue(); } }, + { "entities", n => { Entities = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + { "uuid", n => { Uuid = n.GetStringValue(); } }, + { "value", n => { Value = n.GetFloatValue(); } }, + { "window", n => { Window = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alerts", Alerts); + writer.WriteEnumValue("compare", Compare); + writer.WriteStringValue("description", Description); + writer.WriteBoolValue("enabled", Enabled); + writer.WriteCollectionOfPrimitiveValues("entities", Entities); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteEnumValue("type", Type); + writer.WriteStringValue("uuid", Uuid); + writer.WriteFloatValue("value", Value); + writer.WriteEnumValue("window", Window); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_compare.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_compare.cs new file mode 100644 index 0000000..91d98c6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_compare.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Alert_policy_compare + #pragma warning restore CS1591 + { + [EnumMember(Value = "GreaterThan")] + #pragma warning disable CS1591 + GreaterThan, + #pragma warning restore CS1591 + [EnumMember(Value = "LessThan")] + #pragma warning disable CS1591 + LessThan, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request.cs new file mode 100644 index 0000000..e03679e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Alert_policy_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alerts property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alerts? Alerts { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alerts Alerts { get; set; } +#endif + /// The compare property + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request_compare? Compare { get; set; } + /// The description property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The enabled property + public bool? Enabled { get; set; } + /// The entities property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Entities { get; set; } +#nullable restore +#else + public List Entities { get; set; } +#endif + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// The type property + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request_type? Type { get; set; } + /// The value property + public float? Value { get; set; } + /// The window property + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request_window? Window { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Alert_policy_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alerts", n => { Alerts = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alerts.CreateFromDiscriminatorValue); } }, + { "compare", n => { Compare = n.GetEnumValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "enabled", n => { Enabled = n.GetBoolValue(); } }, + { "entities", n => { Entities = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + { "value", n => { Value = n.GetFloatValue(); } }, + { "window", n => { Window = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alerts", Alerts); + writer.WriteEnumValue("compare", Compare); + writer.WriteStringValue("description", Description); + writer.WriteBoolValue("enabled", Enabled); + writer.WriteCollectionOfPrimitiveValues("entities", Entities); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteEnumValue("type", Type); + writer.WriteFloatValue("value", Value); + writer.WriteEnumValue("window", Window); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_compare.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_compare.cs new file mode 100644 index 0000000..975357e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_compare.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Alert_policy_request_compare + #pragma warning restore CS1591 + { + [EnumMember(Value = "GreaterThan")] + #pragma warning disable CS1591 + GreaterThan, + #pragma warning restore CS1591 + [EnumMember(Value = "LessThan")] + #pragma warning disable CS1591 + LessThan, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_type.cs new file mode 100644 index 0000000..1b03dd7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_type.cs @@ -0,0 +1,124 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Alert_policy_request_type + #pragma warning restore CS1591 + { + [EnumMember(Value = "v1/insights/droplet/load_1")] + #pragma warning disable CS1591 + V1InsightsDropletLoad_1, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/load_5")] + #pragma warning disable CS1591 + V1InsightsDropletLoad_5, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/load_15")] + #pragma warning disable CS1591 + V1InsightsDropletLoad_15, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/memory_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsDropletMemory_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/disk_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsDropletDisk_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/cpu")] + #pragma warning disable CS1591 + V1InsightsDropletCpu, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/disk_read")] + #pragma warning disable CS1591 + V1InsightsDropletDisk_read, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/disk_write")] + #pragma warning disable CS1591 + V1InsightsDropletDisk_write, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/public_outbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPublic_outbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/public_inbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPublic_inbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/private_outbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPrivate_outbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/private_inbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPrivate_inbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/avg_cpu_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsLbaasAvg_cpu_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/connection_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsLbaasConnection_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/droplet_health")] + #pragma warning disable CS1591 + V1InsightsLbaasDroplet_health, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/tls_connections_per_second_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsLbaasTls_connections_per_second_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_percentage_5xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_percentage_4xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_count_5xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_count_5xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_count_4xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_count_4xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time_50p")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time_50p, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time_95p")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time_95p, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time_99p")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time_99p, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/load_15_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsLoad_15_alerts, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/memory_utilization_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsMemory_utilization_alerts, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/disk_utilization_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsDisk_utilization_alerts, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/cpu_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsCpu_alerts, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_window.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_window.cs new file mode 100644 index 0000000..6214032 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_request_window.cs @@ -0,0 +1,28 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Alert_policy_request_window + #pragma warning restore CS1591 + { + [EnumMember(Value = "5m")] + #pragma warning disable CS1591 + Fivem, + #pragma warning restore CS1591 + [EnumMember(Value = "10m")] + #pragma warning disable CS1591 + OneZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "30m")] + #pragma warning disable CS1591 + ThreeZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "1h")] + #pragma warning disable CS1591 + Oneh, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_type.cs new file mode 100644 index 0000000..18072b3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_type.cs @@ -0,0 +1,124 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Alert_policy_type + #pragma warning restore CS1591 + { + [EnumMember(Value = "v1/insights/droplet/load_1")] + #pragma warning disable CS1591 + V1InsightsDropletLoad_1, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/load_5")] + #pragma warning disable CS1591 + V1InsightsDropletLoad_5, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/load_15")] + #pragma warning disable CS1591 + V1InsightsDropletLoad_15, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/memory_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsDropletMemory_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/disk_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsDropletDisk_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/cpu")] + #pragma warning disable CS1591 + V1InsightsDropletCpu, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/disk_read")] + #pragma warning disable CS1591 + V1InsightsDropletDisk_read, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/disk_write")] + #pragma warning disable CS1591 + V1InsightsDropletDisk_write, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/public_outbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPublic_outbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/public_inbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPublic_inbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/private_outbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPrivate_outbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/droplet/private_inbound_bandwidth")] + #pragma warning disable CS1591 + V1InsightsDropletPrivate_inbound_bandwidth, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/avg_cpu_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsLbaasAvg_cpu_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/connection_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsLbaasConnection_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/droplet_health")] + #pragma warning disable CS1591 + V1InsightsLbaasDroplet_health, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/tls_connections_per_second_utilization_percent")] + #pragma warning disable CS1591 + V1InsightsLbaasTls_connections_per_second_utilization_percent, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_percentage_5xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_percentage_4xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_count_5xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_count_5xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/increase_in_http_error_rate_count_4xx")] + #pragma warning disable CS1591 + V1InsightsLbaasIncrease_in_http_error_rate_count_4xx, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time_50p")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time_50p, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time_95p")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time_95p, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/insights/lbaas/high_http_request_response_time_99p")] + #pragma warning disable CS1591 + V1InsightsLbaasHigh_http_request_response_time_99p, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/load_15_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsLoad_15_alerts, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/memory_utilization_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsMemory_utilization_alerts, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/disk_utilization_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsDisk_utilization_alerts, + #pragma warning restore CS1591 + [EnumMember(Value = "v1/dbaas/alerts/cpu_alerts")] + #pragma warning disable CS1591 + V1DbaasAlertsCpu_alerts, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_window.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_window.cs new file mode 100644 index 0000000..748bc37 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_policy_window.cs @@ -0,0 +1,28 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Alert_policy_window + #pragma warning restore CS1591 + { + [EnumMember(Value = "5m")] + #pragma warning disable CS1591 + Fivem, + #pragma warning restore CS1591 + [EnumMember(Value = "10m")] + #pragma warning disable CS1591 + OneZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "30m")] + #pragma warning disable CS1591 + ThreeZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "1h")] + #pragma warning disable CS1591 + Oneh, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_type.cs new file mode 100644 index 0000000..95f9b96 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_type.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of alert. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Alert_type + { + [EnumMember(Value = "latency")] + #pragma warning disable CS1591 + Latency, + #pragma warning restore CS1591 + [EnumMember(Value = "down")] + #pragma warning disable CS1591 + Down, + #pragma warning restore CS1591 + [EnumMember(Value = "down_global")] + #pragma warning disable CS1591 + Down_global, + #pragma warning restore CS1591 + [EnumMember(Value = "ssl_expiry")] + #pragma warning disable CS1591 + Ssl_expiry, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable.cs new file mode 100644 index 0000000..e498002 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable.cs @@ -0,0 +1,91 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Alert_updatable : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The comparison operator used against the alert's threshold. + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_updatable_comparison? Comparison { get; set; } + /// A human-friendly display name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The notification settings for a trigger alert. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Notification? Notifications { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Notification Notifications { get; set; } +#endif + /// Period of time the threshold must be exceeded to trigger the alert. + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_updatable_period? Period { get; set; } + /// The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type. + public int? Threshold { get; set; } + /// The type of alert. + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_updatable_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Alert_updatable() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Alert_updatable CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Alert_updatable(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "comparison", n => { Comparison = n.GetEnumValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "notifications", n => { Notifications = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Notification.CreateFromDiscriminatorValue); } }, + { "period", n => { Period = n.GetEnumValue(); } }, + { "threshold", n => { Threshold = n.GetIntValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("comparison", Comparison); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("notifications", Notifications); + writer.WriteEnumValue("period", Period); + writer.WriteIntValue("threshold", Threshold); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_comparison.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_comparison.cs new file mode 100644 index 0000000..038f309 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_comparison.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The comparison operator used against the alert's threshold. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Alert_updatable_comparison + { + [EnumMember(Value = "greater_than")] + #pragma warning disable CS1591 + Greater_than, + #pragma warning restore CS1591 + [EnumMember(Value = "less_than")] + #pragma warning disable CS1591 + Less_than, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_period.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_period.cs new file mode 100644 index 0000000..c7d283e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_period.cs @@ -0,0 +1,39 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Period of time the threshold must be exceeded to trigger the alert. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Alert_updatable_period + { + [EnumMember(Value = "2m")] + #pragma warning disable CS1591 + Twom, + #pragma warning restore CS1591 + [EnumMember(Value = "3m")] + #pragma warning disable CS1591 + Threem, + #pragma warning restore CS1591 + [EnumMember(Value = "5m")] + #pragma warning disable CS1591 + Fivem, + #pragma warning restore CS1591 + [EnumMember(Value = "10m")] + #pragma warning disable CS1591 + OneZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "15m")] + #pragma warning disable CS1591 + OneFivem, + #pragma warning restore CS1591 + [EnumMember(Value = "30m")] + #pragma warning disable CS1591 + ThreeZerom, + #pragma warning restore CS1591 + [EnumMember(Value = "1h")] + #pragma warning disable CS1591 + Oneh, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_type.cs new file mode 100644 index 0000000..e88bd23 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alert_updatable_type.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of alert. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Alert_updatable_type + { + [EnumMember(Value = "latency")] + #pragma warning disable CS1591 + Latency, + #pragma warning restore CS1591 + [EnumMember(Value = "down")] + #pragma warning disable CS1591 + Down, + #pragma warning restore CS1591 + [EnumMember(Value = "down_global")] + #pragma warning disable CS1591 + Down_global, + #pragma warning restore CS1591 + [EnumMember(Value = "ssl_expiry")] + #pragma warning disable CS1591 + Ssl_expiry, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Alerts.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Alerts.cs new file mode 100644 index 0000000..c5b607e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Alerts.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Alerts : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An email to notify on an alert trigger. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Email { get; set; } +#nullable restore +#else + public List Email { get; set; } +#endif + /// Slack integration details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Slack { get; set; } +#nullable restore +#else + public List Slack { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Alerts() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Alerts CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Alerts(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "email", n => { Email = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "slack", n => { Slack = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Slack_details.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("email", Email); + writer.WriteCollectionOfObjectValues("slack", Slack); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App.cs new file mode 100644 index 0000000..521573b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App.cs @@ -0,0 +1,215 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An application's configuration and status. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App : IAdditionalDataHolder, IParsable + { + /// The active_deployment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment? ActiveDeployment { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment ActiveDeployment { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The created_at property + public DateTimeOffset? CreatedAt { get; private set; } + /// The dedicated_ips property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DedicatedIps { get; private set; } +#nullable restore +#else + public List DedicatedIps { get; private set; } +#endif + /// The default_ingress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DefaultIngress { get; private set; } +#nullable restore +#else + public string DefaultIngress { get; private set; } +#endif + /// The domains property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Domains { get; private set; } +#nullable restore +#else + public List Domains { get; private set; } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; private set; } +#nullable restore +#else + public string Id { get; private set; } +#endif + /// The in_progress_deployment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment? InProgressDeployment { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment InProgressDeployment { get; set; } +#endif + /// The last_deployment_created_at property + public DateTimeOffset? LastDeploymentCreatedAt { get; private set; } + /// The live_domain property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveDomain { get; private set; } +#nullable restore +#else + public string LiveDomain { get; private set; } +#endif + /// The live_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveUrl { get; private set; } +#nullable restore +#else + public string LiveUrl { get; private set; } +#endif + /// The live_url_base property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveUrlBase { get; private set; } +#nullable restore +#else + public string LiveUrlBase { get; private set; } +#endif + /// The owner_uuid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OwnerUuid { get; private set; } +#nullable restore +#else + public string OwnerUuid { get; private set; } +#endif + /// The pending_deployment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment? PendingDeployment { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment PendingDeployment { get; set; } +#endif + /// The pinned_deployment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment? PinnedDeployment { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment PinnedDeployment { get; set; } +#endif + /// The project_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProjectId { get; private set; } +#nullable restore +#else + public string ProjectId { get; private set; } +#endif + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_region? Region { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_region Region { get; set; } +#endif + /// The desired configuration of an application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec Spec { get; set; } +#endif + /// The tier_slug property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TierSlug { get; private set; } +#nullable restore +#else + public string TierSlug { get; private set; } +#endif + /// The updated_at property + public DateTimeOffset? UpdatedAt { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public App() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "active_deployment", n => { ActiveDeployment = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment.CreateFromDiscriminatorValue); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "dedicated_ips", n => { DedicatedIps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_dedicated_egress_ip.CreateFromDiscriminatorValue)?.AsList(); } }, + { "default_ingress", n => { DefaultIngress = n.GetStringValue(); } }, + { "domains", n => { Domains = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain.CreateFromDiscriminatorValue)?.AsList(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "in_progress_deployment", n => { InProgressDeployment = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment.CreateFromDiscriminatorValue); } }, + { "last_deployment_created_at", n => { LastDeploymentCreatedAt = n.GetDateTimeOffsetValue(); } }, + { "live_domain", n => { LiveDomain = n.GetStringValue(); } }, + { "live_url", n => { LiveUrl = n.GetStringValue(); } }, + { "live_url_base", n => { LiveUrlBase = n.GetStringValue(); } }, + { "owner_uuid", n => { OwnerUuid = n.GetStringValue(); } }, + { "pending_deployment", n => { PendingDeployment = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment.CreateFromDiscriminatorValue); } }, + { "pinned_deployment", n => { PinnedDeployment = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment.CreateFromDiscriminatorValue); } }, + { "project_id", n => { ProjectId = n.GetStringValue(); } }, + { "region", n => { Region = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_region.CreateFromDiscriminatorValue); } }, + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_spec.CreateFromDiscriminatorValue); } }, + { "tier_slug", n => { TierSlug = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("active_deployment", ActiveDeployment); + writer.WriteObjectValue("in_progress_deployment", InProgressDeployment); + writer.WriteObjectValue("pending_deployment", PendingDeployment); + writer.WriteObjectValue("pinned_deployment", PinnedDeployment); + writer.WriteObjectValue("region", Region); + writer.WriteObjectValue("spec", Spec); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert.cs new file mode 100644 index 0000000..df99d73 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert.cs @@ -0,0 +1,119 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_alert : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The component_name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ComponentName { get; set; } +#nullable restore +#else + public string ComponentName { get; set; } +#endif + /// The emails property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Emails { get; set; } +#nullable restore +#else + public List Emails { get; set; } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; private set; } +#nullable restore +#else + public string Id { get; private set; } +#endif + /// The phase property + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_phase? Phase { get; set; } + /// The progress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress? Progress { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress Progress { get; set; } +#endif + /// The slack_webhooks property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SlackWebhooks { get; set; } +#nullable restore +#else + public List SlackWebhooks { get; set; } +#endif + /// The spec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec Spec { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_alert() + { + AdditionalData = new Dictionary(); + Phase = global::InfinityFlow.DigitalOcean.Client.Models.App_alert_phase.UNKNOWN; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_alert CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_alert(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "component_name", n => { ComponentName = n.GetStringValue(); } }, + { "emails", n => { Emails = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "phase", n => { Phase = n.GetEnumValue(); } }, + { "progress", n => { Progress = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress.CreateFromDiscriminatorValue); } }, + { "slack_webhooks", n => { SlackWebhooks = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_alert_slack_webhook.CreateFromDiscriminatorValue)?.AsList(); } }, + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("component_name", ComponentName); + writer.WriteCollectionOfPrimitiveValues("emails", Emails); + writer.WriteEnumValue("phase", Phase); + writer.WriteObjectValue("progress", Progress); + writer.WriteCollectionOfObjectValues("slack_webhooks", SlackWebhooks); + writer.WriteObjectValue("spec", Spec); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_phase.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_phase.cs new file mode 100644 index 0000000..22fd4ad --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_phase.cs @@ -0,0 +1,32 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum App_alert_phase + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNKNOWN")] + #pragma warning disable CS1591 + UNKNOWN, + #pragma warning restore CS1591 + [EnumMember(Value = "PENDING")] + #pragma warning disable CS1591 + PENDING, + #pragma warning restore CS1591 + [EnumMember(Value = "CONFIGURING")] + #pragma warning disable CS1591 + CONFIGURING, + #pragma warning restore CS1591 + [EnumMember(Value = "ACTIVE")] + #pragma warning disable CS1591 + ACTIVE, + #pragma warning restore CS1591 + [EnumMember(Value = "ERROR")] + #pragma warning disable CS1591 + ERROR, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress.cs new file mode 100644 index 0000000..cb2d577 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_alert_progress : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The steps property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Steps { get; set; } +#nullable restore +#else + public List Steps { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_alert_progress() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "steps", n => { Steps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("steps", Steps); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step.cs new file mode 100644 index 0000000..4a0b26a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step.cs @@ -0,0 +1,88 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_alert_progress_step : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ended_at property + public DateTimeOffset? EndedAt { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The reason property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step_reason? Reason { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step_reason Reason { get; set; } +#endif + /// The started_at property + public DateTimeOffset? StartedAt { get; set; } + /// The status property + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step_status? Status { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_alert_progress_step() + { + AdditionalData = new Dictionary(); + Status = global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step_status.UNKNOWN; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ended_at", n => { EndedAt = n.GetDateTimeOffsetValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "reason", n => { Reason = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step_reason.CreateFromDiscriminatorValue); } }, + { "started_at", n => { StartedAt = n.GetDateTimeOffsetValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("ended_at", EndedAt); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("reason", Reason); + writer.WriteDateTimeOffsetValue("started_at", StartedAt); + writer.WriteEnumValue("status", Status); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step_reason.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step_reason.cs new file mode 100644 index 0000000..e2b2704 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step_reason.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_alert_progress_step_reason : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The code property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Code { get; set; } +#nullable restore +#else + public string Code { get; set; } +#endif + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_alert_progress_step_reason() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step_reason CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_alert_progress_step_reason(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "code", n => { Code = n.GetStringValue(); } }, + { "message", n => { Message = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("code", Code); + writer.WriteStringValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step_status.cs new file mode 100644 index 0000000..251a06a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_progress_step_status.cs @@ -0,0 +1,32 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum App_alert_progress_step_status + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNKNOWN")] + #pragma warning disable CS1591 + UNKNOWN, + #pragma warning restore CS1591 + [EnumMember(Value = "PENDING")] + #pragma warning disable CS1591 + PENDING, + #pragma warning restore CS1591 + [EnumMember(Value = "RUNNING")] + #pragma warning disable CS1591 + RUNNING, + #pragma warning restore CS1591 + [EnumMember(Value = "ERROR")] + #pragma warning disable CS1591 + ERROR, + #pragma warning restore CS1591 + [EnumMember(Value = "SUCCESS")] + #pragma warning disable CS1591 + SUCCESS, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_slack_webhook.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_slack_webhook.cs new file mode 100644 index 0000000..a39071a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_slack_webhook.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_alert_slack_webhook : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The channel property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Channel { get; set; } +#nullable restore +#else + public string Channel { get; set; } +#endif + /// The url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_alert_slack_webhook() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_alert_slack_webhook CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_alert_slack_webhook(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "channel", n => { Channel = n.GetStringValue(); } }, + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("channel", Channel); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec.cs new file mode 100644 index 0000000..2fba833 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec.cs @@ -0,0 +1,78 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_alert_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Is the alert disabled? + public bool? Disabled { get; set; } + /// The operator property + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec_operator? Operator { get; set; } + /// The rule property + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec_rule? Rule { get; set; } + /// Threshold value for alert + public float? Value { get; set; } + /// The window property + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec_window? Window { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_alert_spec() + { + AdditionalData = new Dictionary(); + Operator = global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec_operator.UNSPECIFIED_OPERATOR; + Rule = global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec_rule.UNSPECIFIED_RULE; + Window = global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec_window.UNSPECIFIED_WINDOW; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "disabled", n => { Disabled = n.GetBoolValue(); } }, + { "operator", n => { Operator = n.GetEnumValue(); } }, + { "rule", n => { Rule = n.GetEnumValue(); } }, + { "value", n => { Value = n.GetFloatValue(); } }, + { "window", n => { Window = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("disabled", Disabled); + writer.WriteEnumValue("operator", Operator); + writer.WriteEnumValue("rule", Rule); + writer.WriteFloatValue("value", Value); + writer.WriteEnumValue("window", Window); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_operator.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_operator.cs new file mode 100644 index 0000000..1083c4f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_operator.cs @@ -0,0 +1,24 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum App_alert_spec_operator + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNSPECIFIED_OPERATOR")] + #pragma warning disable CS1591 + UNSPECIFIED_OPERATOR, + #pragma warning restore CS1591 + [EnumMember(Value = "GREATER_THAN")] + #pragma warning disable CS1591 + GREATER_THAN, + #pragma warning restore CS1591 + [EnumMember(Value = "LESS_THAN")] + #pragma warning disable CS1591 + LESS_THAN, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_rule.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_rule.cs new file mode 100644 index 0000000..140275e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_rule.cs @@ -0,0 +1,68 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum App_alert_spec_rule + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNSPECIFIED_RULE")] + #pragma warning disable CS1591 + UNSPECIFIED_RULE, + #pragma warning restore CS1591 + [EnumMember(Value = "CPU_UTILIZATION")] + #pragma warning disable CS1591 + CPU_UTILIZATION, + #pragma warning restore CS1591 + [EnumMember(Value = "MEM_UTILIZATION")] + #pragma warning disable CS1591 + MEM_UTILIZATION, + #pragma warning restore CS1591 + [EnumMember(Value = "RESTART_COUNT")] + #pragma warning disable CS1591 + RESTART_COUNT, + #pragma warning restore CS1591 + [EnumMember(Value = "DEPLOYMENT_FAILED")] + #pragma warning disable CS1591 + DEPLOYMENT_FAILED, + #pragma warning restore CS1591 + [EnumMember(Value = "DEPLOYMENT_LIVE")] + #pragma warning disable CS1591 + DEPLOYMENT_LIVE, + #pragma warning restore CS1591 + [EnumMember(Value = "DOMAIN_FAILED")] + #pragma warning disable CS1591 + DOMAIN_FAILED, + #pragma warning restore CS1591 + [EnumMember(Value = "DOMAIN_LIVE")] + #pragma warning disable CS1591 + DOMAIN_LIVE, + #pragma warning restore CS1591 + [EnumMember(Value = "FUNCTIONS_ACTIVATION_COUNT")] + #pragma warning disable CS1591 + FUNCTIONS_ACTIVATION_COUNT, + #pragma warning restore CS1591 + [EnumMember(Value = "FUNCTIONS_AVERAGE_DURATION_MS")] + #pragma warning disable CS1591 + FUNCTIONS_AVERAGE_DURATION_MS, + #pragma warning restore CS1591 + [EnumMember(Value = "FUNCTIONS_ERROR_RATE_PER_MINUTE")] + #pragma warning disable CS1591 + FUNCTIONS_ERROR_RATE_PER_MINUTE, + #pragma warning restore CS1591 + [EnumMember(Value = "FUNCTIONS_AVERAGE_WAIT_TIME_MS")] + #pragma warning disable CS1591 + FUNCTIONS_AVERAGE_WAIT_TIME_MS, + #pragma warning restore CS1591 + [EnumMember(Value = "FUNCTIONS_ERROR_COUNT")] + #pragma warning disable CS1591 + FUNCTIONS_ERROR_COUNT, + #pragma warning restore CS1591 + [EnumMember(Value = "FUNCTIONS_GB_RATE_PER_SECOND")] + #pragma warning disable CS1591 + FUNCTIONS_GB_RATE_PER_SECOND, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_window.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_window.cs new file mode 100644 index 0000000..04c8640 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_alert_spec_window.cs @@ -0,0 +1,32 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum App_alert_spec_window + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNSPECIFIED_WINDOW")] + #pragma warning disable CS1591 + UNSPECIFIED_WINDOW, + #pragma warning restore CS1591 + [EnumMember(Value = "FIVE_MINUTES")] + #pragma warning disable CS1591 + FIVE_MINUTES, + #pragma warning restore CS1591 + [EnumMember(Value = "TEN_MINUTES")] + #pragma warning disable CS1591 + TEN_MINUTES, + #pragma warning restore CS1591 + [EnumMember(Value = "THIRTY_MINUTES")] + #pragma warning disable CS1591 + THIRTY_MINUTES, + #pragma warning restore CS1591 + [EnumMember(Value = "ONE_HOUR")] + #pragma warning disable CS1591 + ONE_HOUR, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_component_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_component_base.cs new file mode 100644 index 0000000..a603baf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_component_base.cs @@ -0,0 +1,175 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_component_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An optional build command to run while building this component from source. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BuildCommand { get; set; } +#nullable restore +#else + public string BuildCommand { get; set; } +#endif + /// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DockerfilePath { get; set; } +#nullable restore +#else + public string DockerfilePath { get; set; } +#endif + /// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EnvironmentSlug { get; set; } +#nullable restore +#else + public string EnvironmentSlug { get; set; } +#endif + /// A list of environment variables made available to the component. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Envs { get; set; } +#nullable restore +#else + public List Envs { get; set; } +#endif + /// The git property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec? Git { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec Git { get; set; } +#endif + /// The github property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec? Github { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec Github { get; set; } +#endif + /// The gitlab property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec? Gitlab { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec Gitlab { get; set; } +#endif + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec Image { get; set; } +#endif + /// A list of configured log forwarding destinations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LogDestinations { get; set; } +#nullable restore +#else + public List LogDestinations { get; set; } +#endif + /// The name. Must be unique across all components within the same app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An optional run command to override the component's default. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunCommand { get; set; } +#nullable restore +#else + public string RunCommand { get; set; } +#endif + /// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceDir { get; set; } +#nullable restore +#else + public string SourceDir { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_component_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_component_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_component_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "build_command", n => { BuildCommand = n.GetStringValue(); } }, + { "dockerfile_path", n => { DockerfilePath = n.GetStringValue(); } }, + { "environment_slug", n => { EnvironmentSlug = n.GetStringValue(); } }, + { "envs", n => { Envs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "git", n => { Git = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec.CreateFromDiscriminatorValue); } }, + { "github", n => { Github = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec.CreateFromDiscriminatorValue); } }, + { "gitlab", n => { Gitlab = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec.CreateFromDiscriminatorValue); } }, + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec.CreateFromDiscriminatorValue); } }, + { "log_destinations", n => { LogDestinations = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "run_command", n => { RunCommand = n.GetStringValue(); } }, + { "source_dir", n => { SourceDir = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("build_command", BuildCommand); + writer.WriteStringValue("dockerfile_path", DockerfilePath); + writer.WriteStringValue("environment_slug", EnvironmentSlug); + writer.WriteCollectionOfObjectValues("envs", Envs); + writer.WriteObjectValue("git", Git); + writer.WriteObjectValue("github", Github); + writer.WriteObjectValue("gitlab", Gitlab); + writer.WriteObjectValue("image", Image); + writer.WriteCollectionOfObjectValues("log_destinations", LogDestinations); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("run_command", RunCommand); + writer.WriteStringValue("source_dir", SourceDir); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_database_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_database_spec.cs new file mode 100644 index 0000000..6b778f2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_database_spec.cs @@ -0,0 +1,114 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_database_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterName { get; set; } +#nullable restore +#else + public string ClusterName { get; set; } +#endif + /// The name of the MySQL or PostgreSQL database to configure. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DbName { get; set; } +#nullable restore +#else + public string DbName { get; set; } +#endif + /// The name of the MySQL or PostgreSQL user to configure. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DbUser { get; set; } +#nullable restore +#else + public string DbUser { get; set; } +#endif + /// - MYSQL: MySQL- PG: PostgreSQL- REDIS: Redis- MONGODB: MongoDB- KAFKA: Kafka- OPENSEARCH: OpenSearch + public global::InfinityFlow.DigitalOcean.Client.Models.App_database_spec_engine? Engine { get; set; } + /// The database's name. The name must be unique across all components within the same app and cannot use capital letters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Whether this is a production or dev database. + public bool? Production { get; set; } + /// The version of the database engine +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_database_spec() + { + AdditionalData = new Dictionary(); + Engine = global::InfinityFlow.DigitalOcean.Client.Models.App_database_spec_engine.UNSET; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_database_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_database_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cluster_name", n => { ClusterName = n.GetStringValue(); } }, + { "db_name", n => { DbName = n.GetStringValue(); } }, + { "db_user", n => { DbUser = n.GetStringValue(); } }, + { "engine", n => { Engine = n.GetEnumValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "production", n => { Production = n.GetBoolValue(); } }, + { "version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cluster_name", ClusterName); + writer.WriteStringValue("db_name", DbName); + writer.WriteStringValue("db_user", DbUser); + writer.WriteEnumValue("engine", Engine); + writer.WriteStringValue("name", Name); + writer.WriteBoolValue("production", Production); + writer.WriteStringValue("version", Version); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_database_spec_engine.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_database_spec_engine.cs new file mode 100644 index 0000000..4d95ef7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_database_spec_engine.cs @@ -0,0 +1,39 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// - MYSQL: MySQL- PG: PostgreSQL- REDIS: Redis- MONGODB: MongoDB- KAFKA: Kafka- OPENSEARCH: OpenSearch + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_database_spec_engine + { + [EnumMember(Value = "UNSET")] + #pragma warning disable CS1591 + UNSET, + #pragma warning restore CS1591 + [EnumMember(Value = "MYSQL")] + #pragma warning disable CS1591 + MYSQL, + #pragma warning restore CS1591 + [EnumMember(Value = "PG")] + #pragma warning disable CS1591 + PG, + #pragma warning restore CS1591 + [EnumMember(Value = "REDIS")] + #pragma warning disable CS1591 + REDIS, + #pragma warning restore CS1591 + [EnumMember(Value = "MONGODB")] + #pragma warning disable CS1591 + MONGODB, + #pragma warning restore CS1591 + [EnumMember(Value = "KAFKA")] + #pragma warning disable CS1591 + KAFKA, + #pragma warning restore CS1591 + [EnumMember(Value = "OPENSEARCH")] + #pragma warning disable CS1591 + OPENSEARCH, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec.cs new file mode 100644 index 0000000..51186c3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec.cs @@ -0,0 +1,88 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_domain_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The hostname for the domain +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Domain { get; set; } +#nullable restore +#else + public string Domain { get; set; } +#endif + /// The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: `"1.2"` or `"1.3"`. + public global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec_minimum_tls_version? MinimumTlsVersion { get; set; } + /// - DEFAULT: The default `.ondigitalocean.app` domain assigned to this app- PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.- ALIAS: A non-primary domain + public global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec_type? Type { get; set; } + /// Indicates whether the domain includes all sub-domains, in addition to the given domain + public bool? Wildcard { get; set; } + /// Optional. If the domain uses DigitalOcean DNS and you would like AppPlatform to automatically manage it for you, set this to the name of thedomain on your account.For example, If the domain you are adding is `app.domain.com`, the zonecould be `domain.com`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Zone { get; set; } +#nullable restore +#else + public string Zone { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_domain_spec() + { + AdditionalData = new Dictionary(); + Type = global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec_type.UNSPECIFIED; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain", n => { Domain = n.GetStringValue(); } }, + { "minimum_tls_version", n => { MinimumTlsVersion = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + { "wildcard", n => { Wildcard = n.GetBoolValue(); } }, + { "zone", n => { Zone = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("domain", Domain); + writer.WriteEnumValue("minimum_tls_version", MinimumTlsVersion); + writer.WriteEnumValue("type", Type); + writer.WriteBoolValue("wildcard", Wildcard); + writer.WriteStringValue("zone", Zone); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec_minimum_tls_version.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec_minimum_tls_version.cs new file mode 100644 index 0000000..b2f5351 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec_minimum_tls_version.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: `"1.2"` or `"1.3"`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_domain_spec_minimum_tls_version + { + [EnumMember(Value = "1.2")] + #pragma warning disable CS1591 + OneTwo, + #pragma warning restore CS1591 + [EnumMember(Value = "1.3")] + #pragma warning disable CS1591 + OneThree, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec_type.cs new file mode 100644 index 0000000..0cf76cb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_spec_type.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// - DEFAULT: The default `.ondigitalocean.app` domain assigned to this app- PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.- ALIAS: A non-primary domain + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_domain_spec_type + { + [EnumMember(Value = "UNSPECIFIED")] + #pragma warning disable CS1591 + UNSPECIFIED, + #pragma warning restore CS1591 + [EnumMember(Value = "DEFAULT")] + #pragma warning disable CS1591 + DEFAULT, + #pragma warning restore CS1591 + [EnumMember(Value = "PRIMARY")] + #pragma warning disable CS1591 + PRIMARY, + #pragma warning restore CS1591 + [EnumMember(Value = "ALIAS")] + #pragma warning disable CS1591 + ALIAS, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_validation.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_validation.cs new file mode 100644 index 0000000..f65cc94 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_domain_validation.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_domain_validation : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The txt_name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TxtName { get; private set; } +#nullable restore +#else + public string TxtName { get; private set; } +#endif + /// The txt_value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TxtValue { get; private set; } +#nullable restore +#else + public string TxtValue { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_domain_validation() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_domain_validation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_domain_validation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "txt_name", n => { TxtName = n.GetStringValue(); } }, + { "txt_value", n => { TxtValue = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_egress_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_egress_spec.cs new file mode 100644 index 0000000..b8ed5ce --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_egress_spec.cs @@ -0,0 +1,61 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Specification for app egress configurations. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_egress_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The type property + public global::InfinityFlow.DigitalOcean.Client.Models.App_egress_type_spec? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_egress_spec() + { + AdditionalData = new Dictionary(); + Type = global::InfinityFlow.DigitalOcean.Client.Models.App_egress_type_spec.AUTOASSIGN; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_egress_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_egress_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_egress_type_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_egress_type_spec.cs new file mode 100644 index 0000000..f8e08ca --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_egress_type_spec.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum App_egress_type_spec + #pragma warning restore CS1591 + { + [EnumMember(Value = "AUTOASSIGN")] + #pragma warning disable CS1591 + AUTOASSIGN, + #pragma warning restore CS1591 + [EnumMember(Value = "DEDICATED_IP")] + #pragma warning disable CS1591 + DEDICATED_IP, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_functions_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_functions_spec.cs new file mode 100644 index 0000000..fd79f77 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_functions_spec.cs @@ -0,0 +1,156 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_functions_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alerts property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Alerts { get; set; } +#nullable restore +#else + public List Alerts { get; set; } +#endif + /// The cors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy? Cors { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy Cors { get; set; } +#endif + /// A list of environment variables made available to the component. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Envs { get; set; } +#nullable restore +#else + public List Envs { get; set; } +#endif + /// The git property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec? Git { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec Git { get; set; } +#endif + /// The github property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec? Github { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec Github { get; set; } +#endif + /// The gitlab property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec? Gitlab { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec Gitlab { get; set; } +#endif + /// A list of configured log forwarding destinations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LogDestinations { get; set; } +#nullable restore +#else + public List LogDestinations { get; set; } +#endif + /// The name. Must be unique across all components within the same app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Routes { get; set; } +#nullable restore +#else + public List Routes { get; set; } +#endif + /// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceDir { get; set; } +#nullable restore +#else + public string SourceDir { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_functions_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_functions_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_functions_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alerts", n => { Alerts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_alert_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "cors", n => { Cors = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy.CreateFromDiscriminatorValue); } }, + { "envs", n => { Envs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "git", n => { Git = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec.CreateFromDiscriminatorValue); } }, + { "github", n => { Github = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec.CreateFromDiscriminatorValue); } }, + { "gitlab", n => { Gitlab = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec.CreateFromDiscriminatorValue); } }, + { "log_destinations", n => { LogDestinations = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "routes", n => { Routes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_route_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "source_dir", n => { SourceDir = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("alerts", Alerts); + writer.WriteObjectValue("cors", Cors); + writer.WriteCollectionOfObjectValues("envs", Envs); + writer.WriteObjectValue("git", Git); + writer.WriteObjectValue("github", Github); + writer.WriteObjectValue("gitlab", Gitlab); + writer.WriteCollectionOfObjectValues("log_destinations", LogDestinations); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfObjectValues("routes", Routes); + writer.WriteStringValue("source_dir", SourceDir); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec.cs new file mode 100644 index 0000000..5ea7d43 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Specification for app ingress configurations. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ingress_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Rules { get; set; } +#nullable restore +#else + public List Rules { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_ingress_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "rules", n => { Rules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("rules", Rules); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule.cs new file mode 100644 index 0000000..01b3788 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_ingress_spec_rule : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The component to route to. Only one of `component` or `redirect` may be set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_component? Component { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_component Component { get; set; } +#endif + /// The cors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy? Cors { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy Cors { get; set; } +#endif + /// The match configuration for the rule. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_match? Match { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_match Match { get; set; } +#endif + /// The redirect configuration for the rule. Only one of `component` or `redirect` may be set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_redirect? Redirect { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_redirect Redirect { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_ingress_spec_rule() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "component", n => { Component = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_component.CreateFromDiscriminatorValue); } }, + { "cors", n => { Cors = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy.CreateFromDiscriminatorValue); } }, + { "match", n => { Match = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_match.CreateFromDiscriminatorValue); } }, + { "redirect", n => { Redirect = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_redirect.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("component", Component); + writer.WriteObjectValue("cors", Cors); + writer.WriteObjectValue("match", Match); + writer.WriteObjectValue("redirect", Redirect); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_match.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_match.cs new file mode 100644 index 0000000..50985fb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_match.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The match configuration for the rule. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ingress_spec_rule_match : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The path to match on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_string_match? Path { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_string_match Path { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_ingress_spec_rule_match() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_match CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_match(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "path", n => { Path = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_string_match.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("path", Path); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_routing_component.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_routing_component.cs new file mode 100644 index 0000000..c31c101 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_routing_component.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The component to route to. Only one of `component` or `redirect` may be set. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ingress_spec_rule_routing_component : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the component to route to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with `path=/api` will have requests to `/api/list` trimmed to `/list`. If this value is `true`, the path will remain `/api/list`. Note: this is not applicable for Functions Components and is mutually exclusive with `rewrite`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreservePathPrefix { get; set; } +#nullable restore +#else + public string PreservePathPrefix { get; set; } +#endif + /// An optional field that will rewrite the path of the component to be what is specified here. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with `path=/api` will have requests to `/api/list` trimmed to `/list`. If you specified the rewrite to be `/v1/`, requests to `/api/list` would be rewritten to `/v1/list`. Note: this is mutually exclusive with `preserve_path_prefix`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Rewrite { get; set; } +#nullable restore +#else + public string Rewrite { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_ingress_spec_rule_routing_component() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_component CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_component(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "preserve_path_prefix", n => { PreservePathPrefix = n.GetStringValue(); } }, + { "rewrite", n => { Rewrite = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("preserve_path_prefix", PreservePathPrefix); + writer.WriteStringValue("rewrite", Rewrite); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_routing_redirect.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_routing_redirect.cs new file mode 100644 index 0000000..a130464 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_routing_redirect.cs @@ -0,0 +1,94 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The redirect configuration for the rule. Only one of `component` or `redirect` may be set. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ingress_spec_rule_routing_redirect : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The authority/host to redirect to. This can be a hostname or IP address. Note: use `port` to set the port. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Authority { get; set; } +#nullable restore +#else + public string Authority { get; set; } +#endif + /// The port to redirect to. + public long? Port { get; set; } + /// The redirect code to use. Defaults to `302`. Supported values are 300, 301, 302, 303, 304, 307, 308. + public long? RedirectCode { get; set; } + /// The scheme to redirect to. Supported values are `http` or `https`. Default: `https`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Scheme { get; set; } +#nullable restore +#else + public string Scheme { get; set; } +#endif + /// An optional URI path to redirect to. Note: if this is specified the whole URI of the original request will be overwritten to this value, irrespective of the original request URI being matched. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uri { get; set; } +#nullable restore +#else + public string Uri { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_ingress_spec_rule_routing_redirect() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_redirect CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_routing_redirect(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "authority", n => { Authority = n.GetStringValue(); } }, + { "port", n => { Port = n.GetLongValue(); } }, + { "redirect_code", n => { RedirectCode = n.GetLongValue(); } }, + { "scheme", n => { Scheme = n.GetStringValue(); } }, + { "uri", n => { Uri = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("authority", Authority); + writer.WriteLongValue("port", Port); + writer.WriteLongValue("redirect_code", RedirectCode); + writer.WriteStringValue("scheme", Scheme); + writer.WriteStringValue("uri", Uri); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_string_match.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_string_match.cs new file mode 100644 index 0000000..a703e9f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_ingress_spec_rule_string_match.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The path to match on. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ingress_spec_rule_string_match : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Prefix-based match. For example, `/api` will match `/api`, `/api/`, and any nested paths such as `/api/v1/endpoint`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Prefix { get; set; } +#nullable restore +#else + public string Prefix { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_ingress_spec_rule_string_match() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_string_match CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec_rule_string_match(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "prefix", n => { Prefix = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("prefix", Prefix); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec.cs new file mode 100644 index 0000000..57a4ee4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec.cs @@ -0,0 +1,265 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_job_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Configuration for automatically scaling this component based on metrics. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling? Autoscaling { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling Autoscaling { get; set; } +#endif + /// An optional build command to run while building this component from source. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BuildCommand { get; set; } +#nullable restore +#else + public string BuildCommand { get; set; } +#endif + /// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DockerfilePath { get; set; } +#nullable restore +#else + public string DockerfilePath { get; set; } +#endif + /// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EnvironmentSlug { get; set; } +#nullable restore +#else + public string EnvironmentSlug { get; set; } +#endif + /// A list of environment variables made available to the component. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Envs { get; set; } +#nullable restore +#else + public List Envs { get; set; } +#endif + /// The git property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec? Git { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec Git { get; set; } +#endif + /// The github property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec? Github { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec Github { get; set; } +#endif + /// The gitlab property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec? Gitlab { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec Gitlab { get; set; } +#endif + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec Image { get; set; } +#endif + /// The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used. + public long? InstanceCount { get; set; } + /// The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec.App_job_spec_instance_size_slug? InstanceSizeSlug { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec.App_job_spec_instance_size_slug InstanceSizeSlug { get; set; } +#endif + /// - UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.- PRE_DEPLOY: Indicates a job that runs before an app deployment.- POST_DEPLOY: Indicates a job that runs after an app deployment.- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_kind? Kind { get; set; } + /// A list of configured log forwarding destinations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LogDestinations { get; set; } +#nullable restore +#else + public List LogDestinations { get; set; } +#endif + /// The name. Must be unique across all components within the same app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An optional run command to override the component's default. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunCommand { get; set; } +#nullable restore +#else + public string RunCommand { get; set; } +#endif + /// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceDir { get; set; } +#nullable restore +#else + public string SourceDir { get; set; } +#endif + /// The termination property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_termination? Termination { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_termination Termination { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_job_spec() + { + AdditionalData = new Dictionary(); + Kind = global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_kind.UNSPECIFIED; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "autoscaling", n => { Autoscaling = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling.CreateFromDiscriminatorValue); } }, + { "build_command", n => { BuildCommand = n.GetStringValue(); } }, + { "dockerfile_path", n => { DockerfilePath = n.GetStringValue(); } }, + { "environment_slug", n => { EnvironmentSlug = n.GetStringValue(); } }, + { "envs", n => { Envs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "git", n => { Git = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec.CreateFromDiscriminatorValue); } }, + { "github", n => { Github = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec.CreateFromDiscriminatorValue); } }, + { "gitlab", n => { Gitlab = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec.CreateFromDiscriminatorValue); } }, + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec.CreateFromDiscriminatorValue); } }, + { "instance_count", n => { InstanceCount = n.GetLongValue(); } }, + { "instance_size_slug", n => { InstanceSizeSlug = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec.App_job_spec_instance_size_slug.CreateFromDiscriminatorValue); } }, + { "kind", n => { Kind = n.GetEnumValue(); } }, + { "log_destinations", n => { LogDestinations = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "run_command", n => { RunCommand = n.GetStringValue(); } }, + { "source_dir", n => { SourceDir = n.GetStringValue(); } }, + { "termination", n => { Termination = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_termination.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("autoscaling", Autoscaling); + writer.WriteStringValue("build_command", BuildCommand); + writer.WriteStringValue("dockerfile_path", DockerfilePath); + writer.WriteStringValue("environment_slug", EnvironmentSlug); + writer.WriteCollectionOfObjectValues("envs", Envs); + writer.WriteObjectValue("git", Git); + writer.WriteObjectValue("github", Github); + writer.WriteObjectValue("gitlab", Gitlab); + writer.WriteObjectValue("image", Image); + writer.WriteLongValue("instance_count", InstanceCount); + writer.WriteObjectValue("instance_size_slug", InstanceSizeSlug); + writer.WriteEnumValue("kind", Kind); + writer.WriteCollectionOfObjectValues("log_destinations", LogDestinations); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("run_command", RunCommand); + writer.WriteStringValue("source_dir", SourceDir); + writer.WriteObjectValue("termination", Termination); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_job_spec_instance_size_slug : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec.App_job_spec_instance_size_slug CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec.App_job_spec_instance_size_slug(); + if(parseNode.GetStringValue() is string stringValue) + { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) + { + writer.WriteStringValue(null, String); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling.cs new file mode 100644 index 0000000..30c3f9c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling.cs @@ -0,0 +1,74 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Configuration for automatically scaling this component based on metrics. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_job_spec_autoscaling : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The maximum amount of instances for this component. Must be more than min_instance_count. + public int? MaxInstanceCount { get; set; } + /// The metrics that the component is scaled on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics? Metrics { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics Metrics { get; set; } +#endif + /// The minimum amount of instances for this component. Must be less than max_instance_count. + public int? MinInstanceCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_job_spec_autoscaling() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "max_instance_count", n => { MaxInstanceCount = n.GetIntValue(); } }, + { "metrics", n => { Metrics = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics.CreateFromDiscriminatorValue); } }, + { "min_instance_count", n => { MinInstanceCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("max_instance_count", MaxInstanceCount); + writer.WriteObjectValue("metrics", Metrics); + writer.WriteIntValue("min_instance_count", MinInstanceCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling_metrics.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling_metrics.cs new file mode 100644 index 0000000..2950937 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling_metrics.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The metrics that the component is scaled on. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_job_spec_autoscaling_metrics : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Settings for scaling the component based on CPU utilization. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics_cpu? Cpu { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics_cpu Cpu { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_job_spec_autoscaling_metrics() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cpu", n => { Cpu = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics_cpu.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cpu", Cpu); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling_metrics_cpu.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling_metrics_cpu.cs new file mode 100644 index 0000000..f1b35f2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_autoscaling_metrics_cpu.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Settings for scaling the component based on CPU utilization. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_job_spec_autoscaling_metrics_cpu : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The average target CPU utilization for the component. + public int? Percent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_job_spec_autoscaling_metrics_cpu() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics_cpu CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_autoscaling_metrics_cpu(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "percent", n => { Percent = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_instance_size_slug.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_instance_size_slug.cs new file mode 100644 index 0000000..413e8f8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_instance_size_slug.cs @@ -0,0 +1,67 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb` + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum App_job_spec_instance_size_slug + { + [EnumMember(Value = "apps-s-1vcpu-0.5gb")] + #pragma warning disable CS1591 + AppsS1vcpu05gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-1gb-fixed")] + #pragma warning disable CS1591 + AppsS1vcpu1gbFixed, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-1gb")] + #pragma warning disable CS1591 + AppsS1vcpu1gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-2gb")] + #pragma warning disable CS1591 + AppsS1vcpu2gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-2vcpu-4gb")] + #pragma warning disable CS1591 + AppsS2vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-0.5gb")] + #pragma warning disable CS1591 + AppsD1vcpu05gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-1gb")] + #pragma warning disable CS1591 + AppsD1vcpu1gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-2gb")] + #pragma warning disable CS1591 + AppsD1vcpu2gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-4gb")] + #pragma warning disable CS1591 + AppsD1vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-2vcpu-4gb")] + #pragma warning disable CS1591 + AppsD2vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-2vcpu-8gb")] + #pragma warning disable CS1591 + AppsD2vcpu8gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-4vcpu-8gb")] + #pragma warning disable CS1591 + AppsD4vcpu8gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-4vcpu-16gb")] + #pragma warning disable CS1591 + AppsD4vcpu16gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-8vcpu-32gb")] + #pragma warning disable CS1591 + AppsD8vcpu32gb, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_kind.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_kind.cs new file mode 100644 index 0000000..f6b2f96 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_kind.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// - UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.- PRE_DEPLOY: Indicates a job that runs before an app deployment.- POST_DEPLOY: Indicates a job that runs after an app deployment.- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_job_spec_kind + { + [EnumMember(Value = "UNSPECIFIED")] + #pragma warning disable CS1591 + UNSPECIFIED, + #pragma warning restore CS1591 + [EnumMember(Value = "PRE_DEPLOY")] + #pragma warning disable CS1591 + PRE_DEPLOY, + #pragma warning restore CS1591 + [EnumMember(Value = "POST_DEPLOY")] + #pragma warning disable CS1591 + POST_DEPLOY, + #pragma warning restore CS1591 + [EnumMember(Value = "FAILED_DEPLOY")] + #pragma warning disable CS1591 + FAILED_DEPLOY, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_termination.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_termination.cs new file mode 100644 index 0000000..1a75472 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_job_spec_termination.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_job_spec_termination : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120) + public int? GracePeriodSeconds { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_job_spec_termination() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_termination CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec_termination(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "grace_period_seconds", n => { GracePeriodSeconds = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("grace_period_seconds", GracePeriodSeconds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_datadog_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_datadog_spec.cs new file mode 100644 index 0000000..a763b1b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_datadog_spec.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// DataDog configuration. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_log_destination_datadog_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Datadog API key. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ApiKey { get; set; } +#nullable restore +#else + public string ApiKey { get; set; } +#endif + /// Datadog HTTP log intake endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; set; } +#nullable restore +#else + public string Endpoint { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_log_destination_datadog_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_datadog_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_datadog_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "api_key", n => { ApiKey = n.GetStringValue(); } }, + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("api_key", ApiKey); + writer.WriteStringValue("endpoint", Endpoint); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_definition.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_definition.cs new file mode 100644 index 0000000..4f0cc45 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_definition.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_log_destination_definition : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// DataDog configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_datadog_spec? Datadog { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_datadog_spec Datadog { get; set; } +#endif + /// Logtail configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_logtail_spec? Logtail { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_logtail_spec Logtail { get; set; } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// OpenSearch configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec? OpenSearch { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec OpenSearch { get; set; } +#endif + /// Papertrail configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_papertrail_spec? Papertrail { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_papertrail_spec Papertrail { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_log_destination_definition() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_definition CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_definition(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "datadog", n => { Datadog = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_datadog_spec.CreateFromDiscriminatorValue); } }, + { "logtail", n => { Logtail = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_logtail_spec.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "open_search", n => { OpenSearch = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec.CreateFromDiscriminatorValue); } }, + { "papertrail", n => { Papertrail = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_papertrail_spec.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("datadog", Datadog); + writer.WriteObjectValue("logtail", Logtail); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("open_search", OpenSearch); + writer.WriteObjectValue("papertrail", Papertrail); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_logtail_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_logtail_spec.cs new file mode 100644 index 0000000..9fa2c1f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_logtail_spec.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Logtail configuration. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_log_destination_logtail_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Logtail token. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Token { get; set; } +#nullable restore +#else + public string Token { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_log_destination_logtail_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_logtail_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_logtail_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "token", n => { Token = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("token", Token); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_open_search_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_open_search_spec.cs new file mode 100644 index 0000000..49ba4c2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_open_search_spec.cs @@ -0,0 +1,97 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// OpenSearch configuration. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_log_destination_open_search_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Configure Username and/or Password for Basic authentication. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec_basic_auth? BasicAuth { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec_basic_auth BasicAuth { get; set; } +#endif + /// The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination.Cannot be specified if `endpoint` is also specified. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterName { get; set; } +#nullable restore +#else + public string ClusterName { get; set; } +#endif + /// OpenSearch API Endpoint. Only HTTPS is supported. Format: https://<host>:<port>.Cannot be specified if `cluster_name` is also specified. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; set; } +#nullable restore +#else + public string Endpoint { get; set; } +#endif + /// The index name to use for the logs. If not set, the default index name is "logs". +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexName { get; set; } +#nullable restore +#else + public string IndexName { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_log_destination_open_search_spec() + { + AdditionalData = new Dictionary(); + IndexName = "logs"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basic_auth", n => { BasicAuth = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec_basic_auth.CreateFromDiscriminatorValue); } }, + { "cluster_name", n => { ClusterName = n.GetStringValue(); } }, + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + { "index_name", n => { IndexName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basic_auth", BasicAuth); + writer.WriteStringValue("cluster_name", ClusterName); + writer.WriteStringValue("endpoint", Endpoint); + writer.WriteStringValue("index_name", IndexName); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_open_search_spec_basic_auth.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_open_search_spec_basic_auth.cs new file mode 100644 index 0000000..9eb0fd5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_open_search_spec_basic_auth.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Configure Username and/or Password for Basic authentication. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_log_destination_open_search_spec_basic_auth : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Password for user defined in User. Is required when `endpoint` is set.Cannot be set if using a DigitalOcean DBaaS OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UntypedNode? Password { get; set; } +#nullable restore +#else + public UntypedNode Password { get; set; } +#endif + /// Username to authenticate with. Only required when `endpoint` is set.Defaults to `doadmin` when `cluster_name` is set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_log_destination_open_search_spec_basic_auth() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec_basic_auth CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_open_search_spec_basic_auth(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "password", n => { Password = n.GetObjectValue(UntypedNode.CreateFromDiscriminatorValue); } }, + { "user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("password", Password); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_papertrail_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_papertrail_spec.cs new file mode 100644 index 0000000..5c034e5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_log_destination_papertrail_spec.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Papertrail configuration. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_log_destination_papertrail_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Papertrail syslog endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; set; } +#nullable restore +#else + public string Endpoint { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_log_destination_papertrail_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_papertrail_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_papertrail_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("endpoint", Endpoint); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_maintenance_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_maintenance_spec.cs new file mode 100644 index 0000000..0bf781b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_maintenance_spec.cs @@ -0,0 +1,64 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_maintenance_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Indicates whether the app should be archived. Setting this to true implies that enabled is set to true. Note that this feature is currently in closed beta. + public bool? Archive { get; set; } + /// Indicates whether maintenance mode should be enabled for the app. + public bool? Enabled { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_maintenance_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_maintenance_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_maintenance_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "archive", n => { Archive = n.GetBoolValue(); } }, + { "enabled", n => { Enabled = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("archive", Archive); + writer.WriteBoolValue("enabled", Enabled); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage.cs new file mode 100644 index 0000000..9ccd1f1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_metrics_bandwidth_usage : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of bandwidth usage details by app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AppBandwidthUsage { get; set; } +#nullable restore +#else + public List AppBandwidthUsage { get; set; } +#endif + /// The date for the metrics data. + public DateTimeOffset? Date { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_metrics_bandwidth_usage() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "app_bandwidth_usage", n => { AppBandwidthUsage = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_details.CreateFromDiscriminatorValue)?.AsList(); } }, + { "date", n => { Date = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("app_bandwidth_usage", AppBandwidthUsage); + writer.WriteDateTimeOffsetValue("date", Date); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage_details.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage_details.cs new file mode 100644 index 0000000..bc4bfe6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage_details.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Bandwidth usage for an app. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_metrics_bandwidth_usage_details : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppId { get; set; } +#nullable restore +#else + public string AppId { get; set; } +#endif + /// The used bandwidth amount in bytes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BandwidthBytes { get; set; } +#nullable restore +#else + public string BandwidthBytes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_metrics_bandwidth_usage_details() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_details CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_details(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "app_id", n => { AppId = n.GetStringValue(); } }, + { "bandwidth_bytes", n => { BandwidthBytes = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("app_id", AppId); + writer.WriteStringValue("bandwidth_bytes", BandwidthBytes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage_request.cs new file mode 100644 index 0000000..8088111 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_metrics_bandwidth_usage_request.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_metrics_bandwidth_usage_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of app IDs to query bandwidth metrics for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AppIds { get; set; } +#nullable restore +#else + public List AppIds { get; set; } +#endif + /// Optional day to query. Only the date component of the timestamp will be considered. Default: yesterday. + public DateTimeOffset? Date { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_metrics_bandwidth_usage_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "app_ids", n => { AppIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "date", n => { Date = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("app_ids", AppIds); + writer.WriteDateTimeOffsetValue("date", Date); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_propose.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_propose.cs new file mode 100644 index 0000000..1d1fb3d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_propose.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_propose : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An optional ID of an existing app. If set, the spec will be treated as a proposed update to the specified app. The existing app is not modified using this method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppId { get; set; } +#nullable restore +#else + public string AppId { get; set; } +#endif + /// The desired configuration of an application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec Spec { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_propose() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_propose CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_propose(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "app_id", n => { AppId = n.GetStringValue(); } }, + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_spec.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("app_id", AppId); + writer.WriteObjectValue("spec", Spec); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_propose_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_propose_response.cs new file mode 100644 index 0000000..06af3aa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_propose_response.cs @@ -0,0 +1,102 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_propose_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The monthly cost of the proposed app in USD. + public int? AppCost { get; set; } + /// Indicates whether the app is a static app. + public bool? AppIsStatic { get; set; } + /// Indicates whether the app name is available. + public bool? AppNameAvailable { get; set; } + /// The suggested name if the proposed app name is unavailable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppNameSuggestion { get; set; } +#nullable restore +#else + public string AppNameSuggestion { get; set; } +#endif + /// The monthly cost of the proposed app in USD using the previous pricing plan tier. For example, if you propose an app that uses the Professional tier, the `app_tier_downgrade_cost` field displays the monthly cost of the app if it were to use the Basic tier. If the proposed app already uses the lest expensive tier, the field is empty. + [Obsolete("")] + public int? AppTierDowngradeCost { get; set; } + /// The maximum number of free static apps the account can have. We will charge you for any additional static apps. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExistingStaticApps { get; set; } +#nullable restore +#else + public string ExistingStaticApps { get; set; } +#endif + /// The desired configuration of an application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec Spec { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_propose_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_propose_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_propose_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "app_cost", n => { AppCost = n.GetIntValue(); } }, + { "app_is_static", n => { AppIsStatic = n.GetBoolValue(); } }, + { "app_name_available", n => { AppNameAvailable = n.GetBoolValue(); } }, + { "app_name_suggestion", n => { AppNameSuggestion = n.GetStringValue(); } }, + { "app_tier_downgrade_cost", n => { AppTierDowngradeCost = n.GetIntValue(); } }, + { "existing_static_apps", n => { ExistingStaticApps = n.GetStringValue(); } }, + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_spec.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("app_cost", AppCost); + writer.WriteBoolValue("app_is_static", AppIsStatic); + writer.WriteBoolValue("app_name_available", AppNameAvailable); + writer.WriteStringValue("app_name_suggestion", AppNameSuggestion); + writer.WriteIntValue("app_tier_downgrade_cost", AppTierDowngradeCost); + writer.WriteStringValue("existing_static_apps", ExistingStaticApps); + writer.WriteObjectValue("spec", Spec); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_response.cs new file mode 100644 index 0000000..ab54bc0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An application's configuration and status. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App? App { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App App { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "app", n => { App = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("app", App); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_rollback_validation_condition.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_rollback_validation_condition.cs new file mode 100644 index 0000000..8f99877 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_rollback_validation_condition.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_rollback_validation_condition : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A code identifier that represents the failing condition.Failing conditions: - `incompatible_phase` - indicates that the deployment's phase is not suitable for rollback. - `incompatible_result` - indicates that the deployment's result is not suitable for rollback. - `exceeded_revision_limit` - indicates that the app has exceeded the rollback revision limits for its tier. - `app_pinned` - indicates that there is already a rollback in progress and the app is pinned. - `database_config_conflict` - indicates that the deployment's database config is different than the current config. - `region_conflict` - indicates that the deployment's region differs from the current app region. Warning conditions: - `static_site_requires_rebuild` - indicates that the deployment contains at least one static site that will require a rebuild. - `image_source_missing_digest` - indicates that the deployment contains at least one component with an image source that is missing a digest. + public global::InfinityFlow.DigitalOcean.Client.Models.App_rollback_validation_condition_code? Code { get; set; } + /// The components property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Components { get; set; } +#nullable restore +#else + public List Components { get; set; } +#endif + /// A human-readable message describing the failing condition. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_rollback_validation_condition() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_rollback_validation_condition CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_rollback_validation_condition(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "code", n => { Code = n.GetEnumValue(); } }, + { "components", n => { Components = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "message", n => { Message = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("code", Code); + writer.WriteCollectionOfPrimitiveValues("components", Components); + writer.WriteStringValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_rollback_validation_condition_code.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_rollback_validation_condition_code.cs new file mode 100644 index 0000000..cc0b198 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_rollback_validation_condition_code.cs @@ -0,0 +1,43 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A code identifier that represents the failing condition.Failing conditions: - `incompatible_phase` - indicates that the deployment's phase is not suitable for rollback. - `incompatible_result` - indicates that the deployment's result is not suitable for rollback. - `exceeded_revision_limit` - indicates that the app has exceeded the rollback revision limits for its tier. - `app_pinned` - indicates that there is already a rollback in progress and the app is pinned. - `database_config_conflict` - indicates that the deployment's database config is different than the current config. - `region_conflict` - indicates that the deployment's region differs from the current app region. Warning conditions: - `static_site_requires_rebuild` - indicates that the deployment contains at least one static site that will require a rebuild. - `image_source_missing_digest` - indicates that the deployment contains at least one component with an image source that is missing a digest. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_rollback_validation_condition_code + { + [EnumMember(Value = "incompatible_phase")] + #pragma warning disable CS1591 + Incompatible_phase, + #pragma warning restore CS1591 + [EnumMember(Value = "incompatible_result")] + #pragma warning disable CS1591 + Incompatible_result, + #pragma warning restore CS1591 + [EnumMember(Value = "exceeded_revision_limit")] + #pragma warning disable CS1591 + Exceeded_revision_limit, + #pragma warning restore CS1591 + [EnumMember(Value = "app_pinned")] + #pragma warning disable CS1591 + App_pinned, + #pragma warning restore CS1591 + [EnumMember(Value = "database_config_conflict")] + #pragma warning disable CS1591 + Database_config_conflict, + #pragma warning restore CS1591 + [EnumMember(Value = "region_conflict")] + #pragma warning disable CS1591 + Region_conflict, + #pragma warning restore CS1591 + [EnumMember(Value = "static_site_requires_rebuild")] + #pragma warning disable CS1591 + Static_site_requires_rebuild, + #pragma warning restore CS1591 + [EnumMember(Value = "image_source_missing_digest")] + #pragma warning disable CS1591 + Image_source_missing_digest, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_route_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_route_spec.cs new file mode 100644 index 0000000..965f32f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_route_spec.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_route_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// (Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with `path=/api` will have requests to `/api/list` trimmed to `/list`. If this value is `true`, the path will remain `/api/list`. + public bool? PreservePathPrefix { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_route_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_route_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_route_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "path", n => { Path = n.GetStringValue(); } }, + { "preserve_path_prefix", n => { PreservePathPrefix = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("path", Path); + writer.WriteBoolValue("preserve_path_prefix", PreservePathPrefix); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec.cs new file mode 100644 index 0000000..e71ff96 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec.cs @@ -0,0 +1,309 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_service_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Configuration for automatically scaling this component based on metrics. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling? Autoscaling { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling Autoscaling { get; set; } +#endif + /// An optional build command to run while building this component from source. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BuildCommand { get; set; } +#nullable restore +#else + public string BuildCommand { get; set; } +#endif + /// The cors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy? Cors { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy Cors { get; set; } +#endif + /// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DockerfilePath { get; set; } +#nullable restore +#else + public string DockerfilePath { get; set; } +#endif + /// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EnvironmentSlug { get; set; } +#nullable restore +#else + public string EnvironmentSlug { get; set; } +#endif + /// A list of environment variables made available to the component. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Envs { get; set; } +#nullable restore +#else + public List Envs { get; set; } +#endif + /// The git property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec? Git { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec Git { get; set; } +#endif + /// The github property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec? Github { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec Github { get; set; } +#endif + /// The gitlab property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec? Gitlab { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec Gitlab { get; set; } +#endif + /// The health_check property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_health_check? HealthCheck { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_health_check HealthCheck { get; set; } +#endif + /// The internal port on which this service's run command will listen. Default: 8080If there is not an environment variable with the name `PORT`, one will be automatically added with its value set to the value of this field. + public long? HttpPort { get; set; } + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec Image { get; set; } +#endif + /// The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used. + public long? InstanceCount { get; set; } + /// The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec.App_service_spec_instance_size_slug? InstanceSizeSlug { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec.App_service_spec_instance_size_slug InstanceSizeSlug { get; set; } +#endif + /// The ports on which this service will listen for internal traffic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? InternalPorts { get; set; } +#nullable restore +#else + public List InternalPorts { get; set; } +#endif + /// A list of configured log forwarding destinations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LogDestinations { get; set; } +#nullable restore +#else + public List LogDestinations { get; set; } +#endif + /// The name. Must be unique across all components within the same app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The protocol which the service uses to serve traffic on the http_port.- `HTTP`: The app is serving the HTTP protocol. Default.- `HTTP2`: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c). + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_protocol? Protocol { get; set; } + /// (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Routes { get; set; } +#nullable restore +#else + public List Routes { get; set; } +#endif + /// An optional run command to override the component's default. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunCommand { get; set; } +#nullable restore +#else + public string RunCommand { get; set; } +#endif + /// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceDir { get; set; } +#nullable restore +#else + public string SourceDir { get; set; } +#endif + /// The termination property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_termination? Termination { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_termination Termination { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_service_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "autoscaling", n => { Autoscaling = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling.CreateFromDiscriminatorValue); } }, + { "build_command", n => { BuildCommand = n.GetStringValue(); } }, + { "cors", n => { Cors = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy.CreateFromDiscriminatorValue); } }, + { "dockerfile_path", n => { DockerfilePath = n.GetStringValue(); } }, + { "environment_slug", n => { EnvironmentSlug = n.GetStringValue(); } }, + { "envs", n => { Envs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "git", n => { Git = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec.CreateFromDiscriminatorValue); } }, + { "github", n => { Github = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec.CreateFromDiscriminatorValue); } }, + { "gitlab", n => { Gitlab = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec.CreateFromDiscriminatorValue); } }, + { "health_check", n => { HealthCheck = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_health_check.CreateFromDiscriminatorValue); } }, + { "http_port", n => { HttpPort = n.GetLongValue(); } }, + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec.CreateFromDiscriminatorValue); } }, + { "instance_count", n => { InstanceCount = n.GetLongValue(); } }, + { "instance_size_slug", n => { InstanceSizeSlug = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec.App_service_spec_instance_size_slug.CreateFromDiscriminatorValue); } }, + { "internal_ports", n => { InternalPorts = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "log_destinations", n => { LogDestinations = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "protocol", n => { Protocol = n.GetEnumValue(); } }, + { "routes", n => { Routes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_route_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "run_command", n => { RunCommand = n.GetStringValue(); } }, + { "source_dir", n => { SourceDir = n.GetStringValue(); } }, + { "termination", n => { Termination = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_termination.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("autoscaling", Autoscaling); + writer.WriteStringValue("build_command", BuildCommand); + writer.WriteObjectValue("cors", Cors); + writer.WriteStringValue("dockerfile_path", DockerfilePath); + writer.WriteStringValue("environment_slug", EnvironmentSlug); + writer.WriteCollectionOfObjectValues("envs", Envs); + writer.WriteObjectValue("git", Git); + writer.WriteObjectValue("github", Github); + writer.WriteObjectValue("gitlab", Gitlab); + writer.WriteObjectValue("health_check", HealthCheck); + writer.WriteLongValue("http_port", HttpPort); + writer.WriteObjectValue("image", Image); + writer.WriteLongValue("instance_count", InstanceCount); + writer.WriteObjectValue("instance_size_slug", InstanceSizeSlug); + writer.WriteCollectionOfPrimitiveValues("internal_ports", InternalPorts); + writer.WriteCollectionOfObjectValues("log_destinations", LogDestinations); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("protocol", Protocol); + writer.WriteCollectionOfObjectValues("routes", Routes); + writer.WriteStringValue("run_command", RunCommand); + writer.WriteStringValue("source_dir", SourceDir); + writer.WriteObjectValue("termination", Termination); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_service_spec_instance_size_slug : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec.App_service_spec_instance_size_slug CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec.App_service_spec_instance_size_slug(); + if(parseNode.GetStringValue() is string stringValue) + { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) + { + writer.WriteStringValue(null, String); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling.cs new file mode 100644 index 0000000..7493f79 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling.cs @@ -0,0 +1,74 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Configuration for automatically scaling this component based on metrics. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_service_spec_autoscaling : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The maximum amount of instances for this component. Must be more than min_instance_count. + public int? MaxInstanceCount { get; set; } + /// The metrics that the component is scaled on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics? Metrics { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics Metrics { get; set; } +#endif + /// The minimum amount of instances for this component. Must be less than max_instance_count. + public int? MinInstanceCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_service_spec_autoscaling() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "max_instance_count", n => { MaxInstanceCount = n.GetIntValue(); } }, + { "metrics", n => { Metrics = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics.CreateFromDiscriminatorValue); } }, + { "min_instance_count", n => { MinInstanceCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("max_instance_count", MaxInstanceCount); + writer.WriteObjectValue("metrics", Metrics); + writer.WriteIntValue("min_instance_count", MinInstanceCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling_metrics.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling_metrics.cs new file mode 100644 index 0000000..7f7d66b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling_metrics.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The metrics that the component is scaled on. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_service_spec_autoscaling_metrics : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Settings for scaling the component based on CPU utilization. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics_cpu? Cpu { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics_cpu Cpu { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_service_spec_autoscaling_metrics() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cpu", n => { Cpu = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics_cpu.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cpu", Cpu); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling_metrics_cpu.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling_metrics_cpu.cs new file mode 100644 index 0000000..aacd519 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_autoscaling_metrics_cpu.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Settings for scaling the component based on CPU utilization. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_service_spec_autoscaling_metrics_cpu : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The average target CPU utilization for the component. + public int? Percent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_service_spec_autoscaling_metrics_cpu() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics_cpu CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_autoscaling_metrics_cpu(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "percent", n => { Percent = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_health_check.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_health_check.cs new file mode 100644 index 0000000..93e9191 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_health_check.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_service_spec_health_check : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of failed health checks before considered unhealthy. + public int? FailureThreshold { get; set; } + /// The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? HttpPath { get; set; } +#nullable restore +#else + public string HttpPath { get; set; } +#endif + /// The number of seconds to wait before beginning health checks. + public int? InitialDelaySeconds { get; set; } + /// The number of seconds to wait between health checks. + public int? PeriodSeconds { get; set; } + /// The port on which the health check will be performed. If not set, the health check will be performed on the component's http_port. + public long? Port { get; set; } + /// The number of successful health checks before considered healthy. + public int? SuccessThreshold { get; set; } + /// The number of seconds after which the check times out. + public int? TimeoutSeconds { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_service_spec_health_check() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_health_check CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_health_check(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "failure_threshold", n => { FailureThreshold = n.GetIntValue(); } }, + { "http_path", n => { HttpPath = n.GetStringValue(); } }, + { "initial_delay_seconds", n => { InitialDelaySeconds = n.GetIntValue(); } }, + { "period_seconds", n => { PeriodSeconds = n.GetIntValue(); } }, + { "port", n => { Port = n.GetLongValue(); } }, + { "success_threshold", n => { SuccessThreshold = n.GetIntValue(); } }, + { "timeout_seconds", n => { TimeoutSeconds = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("failure_threshold", FailureThreshold); + writer.WriteStringValue("http_path", HttpPath); + writer.WriteIntValue("initial_delay_seconds", InitialDelaySeconds); + writer.WriteIntValue("period_seconds", PeriodSeconds); + writer.WriteLongValue("port", Port); + writer.WriteIntValue("success_threshold", SuccessThreshold); + writer.WriteIntValue("timeout_seconds", TimeoutSeconds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_instance_size_slug.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_instance_size_slug.cs new file mode 100644 index 0000000..ab714d7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_instance_size_slug.cs @@ -0,0 +1,67 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb` + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum App_service_spec_instance_size_slug + { + [EnumMember(Value = "apps-s-1vcpu-0.5gb")] + #pragma warning disable CS1591 + AppsS1vcpu05gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-1gb-fixed")] + #pragma warning disable CS1591 + AppsS1vcpu1gbFixed, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-1gb")] + #pragma warning disable CS1591 + AppsS1vcpu1gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-2gb")] + #pragma warning disable CS1591 + AppsS1vcpu2gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-2vcpu-4gb")] + #pragma warning disable CS1591 + AppsS2vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-0.5gb")] + #pragma warning disable CS1591 + AppsD1vcpu05gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-1gb")] + #pragma warning disable CS1591 + AppsD1vcpu1gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-2gb")] + #pragma warning disable CS1591 + AppsD1vcpu2gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-4gb")] + #pragma warning disable CS1591 + AppsD1vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-2vcpu-4gb")] + #pragma warning disable CS1591 + AppsD2vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-2vcpu-8gb")] + #pragma warning disable CS1591 + AppsD2vcpu8gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-4vcpu-8gb")] + #pragma warning disable CS1591 + AppsD4vcpu8gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-4vcpu-16gb")] + #pragma warning disable CS1591 + AppsD4vcpu16gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-8vcpu-32gb")] + #pragma warning disable CS1591 + AppsD8vcpu32gb, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_protocol.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_protocol.cs new file mode 100644 index 0000000..0fdf746 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_protocol.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The protocol which the service uses to serve traffic on the http_port.- `HTTP`: The app is serving the HTTP protocol. Default.- `HTTP2`: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c). + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_service_spec_protocol + { + [EnumMember(Value = "HTTP")] + #pragma warning disable CS1591 + HTTP, + #pragma warning restore CS1591 + [EnumMember(Value = "HTTP2")] + #pragma warning disable CS1591 + HTTP2, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_termination.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_termination.cs new file mode 100644 index 0000000..e4d35a7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_service_spec_termination.cs @@ -0,0 +1,63 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_service_spec_termination : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. (Default 15) + public int? DrainSeconds { get; set; } + /// The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120) + public int? GracePeriodSeconds { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_service_spec_termination() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_termination CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec_termination(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "drain_seconds", n => { DrainSeconds = n.GetIntValue(); } }, + { "grace_period_seconds", n => { GracePeriodSeconds = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("drain_seconds", DrainSeconds); + writer.WriteIntValue("grace_period_seconds", GracePeriodSeconds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_spec.cs new file mode 100644 index 0000000..ff0da17 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_spec.cs @@ -0,0 +1,170 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The desired configuration of an application. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_spec : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Database instances which can provide persistence to workloads within theapplication. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Databases { get; set; } +#nullable restore +#else + public List Databases { get; set; } +#endif + /// A set of hostnames where the application will be available. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Domains { get; set; } +#nullable restore +#else + public List Domains { get; set; } +#endif + /// Specification for app egress configurations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_egress_spec? Egress { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_egress_spec Egress { get; set; } +#endif + /// Workloads which expose publicly-accessible HTTP services via Functions Components. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Functions { get; set; } +#nullable restore +#else + public List Functions { get; set; } +#endif + /// Specification for app ingress configurations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec? Ingress { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec Ingress { get; set; } +#endif + /// Pre and post deployment workloads which do not expose publicly-accessible HTTP routes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Jobs { get; set; } +#nullable restore +#else + public List Jobs { get; set; } +#endif + /// Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_maintenance_spec? Maintenance { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_maintenance_spec Maintenance { get; set; } +#endif + /// The name of the app. Must be unique across all apps in the same account. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The slug form of the geographical origin of the app. Default: `nearest available` + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec_region? Region { get; set; } + /// Workloads which expose publicly-accessible HTTP services. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Services { get; set; } +#nullable restore +#else + public List Services { get; set; } +#endif + /// Content which can be rendered to static web assets. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? StaticSites { get; set; } +#nullable restore +#else + public List StaticSites { get; set; } +#endif + /// Workloads which do not expose publicly-accessible HTTP services. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Workers { get; set; } +#nullable restore +#else + public List Workers { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "databases", n => { Databases = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_database_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "domains", n => { Domains = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "egress", n => { Egress = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_egress_spec.CreateFromDiscriminatorValue); } }, + { "functions", n => { Functions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_functions_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "ingress", n => { Ingress = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_ingress_spec.CreateFromDiscriminatorValue); } }, + { "jobs", n => { Jobs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_job_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "maintenance", n => { Maintenance = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_maintenance_spec.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "region", n => { Region = n.GetEnumValue(); } }, + { "services", n => { Services = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_service_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "static_sites", n => { StaticSites = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_static_site_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + { "workers", n => { Workers = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("databases", Databases); + writer.WriteCollectionOfObjectValues("domains", Domains); + writer.WriteObjectValue("egress", Egress); + writer.WriteCollectionOfObjectValues("functions", Functions); + writer.WriteObjectValue("ingress", Ingress); + writer.WriteCollectionOfObjectValues("jobs", Jobs); + writer.WriteObjectValue("maintenance", Maintenance); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("region", Region); + writer.WriteCollectionOfObjectValues("services", Services); + writer.WriteCollectionOfObjectValues("static_sites", StaticSites); + writer.WriteCollectionOfObjectValues("workers", Workers); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_spec_region.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_spec_region.cs new file mode 100644 index 0000000..3dd7018 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_spec_region.cs @@ -0,0 +1,47 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The slug form of the geographical origin of the app. Default: `nearest available` + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_spec_region + { + [EnumMember(Value = "ams")] + #pragma warning disable CS1591 + Ams, + #pragma warning restore CS1591 + [EnumMember(Value = "nyc")] + #pragma warning disable CS1591 + Nyc, + #pragma warning restore CS1591 + [EnumMember(Value = "fra")] + #pragma warning disable CS1591 + Fra, + #pragma warning restore CS1591 + [EnumMember(Value = "sfo")] + #pragma warning disable CS1591 + Sfo, + #pragma warning restore CS1591 + [EnumMember(Value = "sgp")] + #pragma warning disable CS1591 + Sgp, + #pragma warning restore CS1591 + [EnumMember(Value = "blr")] + #pragma warning disable CS1591 + Blr, + #pragma warning restore CS1591 + [EnumMember(Value = "tor")] + #pragma warning disable CS1591 + Tor, + #pragma warning restore CS1591 + [EnumMember(Value = "lon")] + #pragma warning disable CS1591 + Lon, + #pragma warning restore CS1591 + [EnumMember(Value = "syd")] + #pragma warning disable CS1591 + Syd, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_static_site_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_static_site_spec.cs new file mode 100644 index 0000000..e0c6015 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_static_site_spec.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_static_site_spec : global::InfinityFlow.DigitalOcean.Client.Models.App_component_base, IParsable + #pragma warning restore CS1591 + { + /// The name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of `catchall_document` or `error_document` can be set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CatchallDocument { get; set; } +#nullable restore +#else + public string CatchallDocument { get; set; } +#endif + /// The cors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy? Cors { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy Cors { get; set; } +#endif + /// The name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ErrorDocument { get; set; } +#nullable restore +#else + public string ErrorDocument { get; set; } +#endif + /// The name of the index document to use when serving this static site. Default: index.html +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexDocument { get; set; } +#nullable restore +#else + public string IndexDocument { get; set; } +#endif + /// An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: `_static`, `dist`, `public`, `build`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OutputDir { get; set; } +#nullable restore +#else + public string OutputDir { get; set; } +#endif + /// (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Routes { get; set; } +#nullable restore +#else + public List Routes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_static_site_spec() : base() + { + ErrorDocument = "404.html"; + IndexDocument = "index.html"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.App_static_site_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_static_site_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "catchall_document", n => { CatchallDocument = n.GetStringValue(); } }, + { "cors", n => { Cors = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy.CreateFromDiscriminatorValue); } }, + { "error_document", n => { ErrorDocument = n.GetStringValue(); } }, + { "index_document", n => { IndexDocument = n.GetStringValue(); } }, + { "output_dir", n => { OutputDir = n.GetStringValue(); } }, + { "routes", n => { Routes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_route_spec.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("catchall_document", CatchallDocument); + writer.WriteObjectValue("cors", Cors); + writer.WriteStringValue("error_document", ErrorDocument); + writer.WriteStringValue("index_document", IndexDocument); + writer.WriteStringValue("output_dir", OutputDir); + writer.WriteCollectionOfObjectValues("routes", Routes); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition.cs new file mode 100644 index 0000000..f006069 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_variable_definition : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The variable name +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// - RUN_TIME: Made available only at run-time- BUILD_TIME: Made available only at build-time- RUN_AND_BUILD_TIME: Made available at both build and run-time + public global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition_scope? Scope { get; set; } + /// - GENERAL: A plain-text environment variable- SECRET: A secret encrypted environment variable + public global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition_type? Type { get; set; } + /// The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_variable_definition() + { + AdditionalData = new Dictionary(); + Scope = global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition_scope.RUN_AND_BUILD_TIME; + Type = global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition_type.GENERAL; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "key", n => { Key = n.GetStringValue(); } }, + { "scope", n => { Scope = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("key", Key); + writer.WriteEnumValue("scope", Scope); + writer.WriteEnumValue("type", Type); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition_scope.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition_scope.cs new file mode 100644 index 0000000..ce1b5bc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition_scope.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// - RUN_TIME: Made available only at run-time- BUILD_TIME: Made available only at build-time- RUN_AND_BUILD_TIME: Made available at both build and run-time + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_variable_definition_scope + { + [EnumMember(Value = "UNSET")] + #pragma warning disable CS1591 + UNSET, + #pragma warning restore CS1591 + [EnumMember(Value = "RUN_TIME")] + #pragma warning disable CS1591 + RUN_TIME, + #pragma warning restore CS1591 + [EnumMember(Value = "BUILD_TIME")] + #pragma warning disable CS1591 + BUILD_TIME, + #pragma warning restore CS1591 + [EnumMember(Value = "RUN_AND_BUILD_TIME")] + #pragma warning disable CS1591 + RUN_AND_BUILD_TIME, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition_type.cs new file mode 100644 index 0000000..fdd0327 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_variable_definition_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// - GENERAL: A plain-text environment variable- SECRET: A secret encrypted environment variable + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum App_variable_definition_type + { + [EnumMember(Value = "GENERAL")] + #pragma warning disable CS1591 + GENERAL, + #pragma warning restore CS1591 + [EnumMember(Value = "SECRET")] + #pragma warning disable CS1591 + SECRET, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec.cs new file mode 100644 index 0000000..c2b8fe5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec.cs @@ -0,0 +1,260 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_worker_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Configuration for automatically scaling this component based on metrics. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling? Autoscaling { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling Autoscaling { get; set; } +#endif + /// An optional build command to run while building this component from source. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BuildCommand { get; set; } +#nullable restore +#else + public string BuildCommand { get; set; } +#endif + /// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DockerfilePath { get; set; } +#nullable restore +#else + public string DockerfilePath { get; set; } +#endif + /// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EnvironmentSlug { get; set; } +#nullable restore +#else + public string EnvironmentSlug { get; set; } +#endif + /// A list of environment variables made available to the component. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Envs { get; set; } +#nullable restore +#else + public List Envs { get; set; } +#endif + /// The git property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec? Git { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec Git { get; set; } +#endif + /// The github property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec? Github { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec Github { get; set; } +#endif + /// The gitlab property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec? Gitlab { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec Gitlab { get; set; } +#endif + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec Image { get; set; } +#endif + /// The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used. + public long? InstanceCount { get; set; } + /// The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec.App_worker_spec_instance_size_slug? InstanceSizeSlug { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec.App_worker_spec_instance_size_slug InstanceSizeSlug { get; set; } +#endif + /// A list of configured log forwarding destinations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LogDestinations { get; set; } +#nullable restore +#else + public List LogDestinations { get; set; } +#endif + /// The name. Must be unique across all components within the same app. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An optional run command to override the component's default. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunCommand { get; set; } +#nullable restore +#else + public string RunCommand { get; set; } +#endif + /// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceDir { get; set; } +#nullable restore +#else + public string SourceDir { get; set; } +#endif + /// The termination property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_termination? Termination { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_termination Termination { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_worker_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "autoscaling", n => { Autoscaling = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling.CreateFromDiscriminatorValue); } }, + { "build_command", n => { BuildCommand = n.GetStringValue(); } }, + { "dockerfile_path", n => { DockerfilePath = n.GetStringValue(); } }, + { "environment_slug", n => { EnvironmentSlug = n.GetStringValue(); } }, + { "envs", n => { Envs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_variable_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "git", n => { Git = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec.CreateFromDiscriminatorValue); } }, + { "github", n => { Github = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec.CreateFromDiscriminatorValue); } }, + { "gitlab", n => { Gitlab = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec.CreateFromDiscriminatorValue); } }, + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec.CreateFromDiscriminatorValue); } }, + { "instance_count", n => { InstanceCount = n.GetLongValue(); } }, + { "instance_size_slug", n => { InstanceSizeSlug = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec.App_worker_spec_instance_size_slug.CreateFromDiscriminatorValue); } }, + { "log_destinations", n => { LogDestinations = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_log_destination_definition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "run_command", n => { RunCommand = n.GetStringValue(); } }, + { "source_dir", n => { SourceDir = n.GetStringValue(); } }, + { "termination", n => { Termination = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_termination.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("autoscaling", Autoscaling); + writer.WriteStringValue("build_command", BuildCommand); + writer.WriteStringValue("dockerfile_path", DockerfilePath); + writer.WriteStringValue("environment_slug", EnvironmentSlug); + writer.WriteCollectionOfObjectValues("envs", Envs); + writer.WriteObjectValue("git", Git); + writer.WriteObjectValue("github", Github); + writer.WriteObjectValue("gitlab", Gitlab); + writer.WriteObjectValue("image", Image); + writer.WriteLongValue("instance_count", InstanceCount); + writer.WriteObjectValue("instance_size_slug", InstanceSizeSlug); + writer.WriteCollectionOfObjectValues("log_destinations", LogDestinations); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("run_command", RunCommand); + writer.WriteStringValue("source_dir", SourceDir); + writer.WriteObjectValue("termination", Termination); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_worker_spec_instance_size_slug : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec.App_worker_spec_instance_size_slug CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec.App_worker_spec_instance_size_slug(); + if(parseNode.GetStringValue() is string stringValue) + { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) + { + writer.WriteStringValue(null, String); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling.cs new file mode 100644 index 0000000..807154a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling.cs @@ -0,0 +1,74 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Configuration for automatically scaling this component based on metrics. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_worker_spec_autoscaling : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The maximum amount of instances for this component. Must be more than min_instance_count. + public int? MaxInstanceCount { get; set; } + /// The metrics that the component is scaled on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics? Metrics { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics Metrics { get; set; } +#endif + /// The minimum amount of instances for this component. Must be less than max_instance_count. + public int? MinInstanceCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_worker_spec_autoscaling() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "max_instance_count", n => { MaxInstanceCount = n.GetIntValue(); } }, + { "metrics", n => { Metrics = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics.CreateFromDiscriminatorValue); } }, + { "min_instance_count", n => { MinInstanceCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("max_instance_count", MaxInstanceCount); + writer.WriteObjectValue("metrics", Metrics); + writer.WriteIntValue("min_instance_count", MinInstanceCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling_metrics.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling_metrics.cs new file mode 100644 index 0000000..e5e1e29 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling_metrics.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The metrics that the component is scaled on. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_worker_spec_autoscaling_metrics : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Settings for scaling the component based on CPU utilization. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics_cpu? Cpu { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics_cpu Cpu { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public App_worker_spec_autoscaling_metrics() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cpu", n => { Cpu = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics_cpu.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cpu", Cpu); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling_metrics_cpu.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling_metrics_cpu.cs new file mode 100644 index 0000000..c3a61cd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_autoscaling_metrics_cpu.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Settings for scaling the component based on CPU utilization. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_worker_spec_autoscaling_metrics_cpu : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The average target CPU utilization for the component. + public int? Percent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_worker_spec_autoscaling_metrics_cpu() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics_cpu CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_autoscaling_metrics_cpu(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "percent", n => { Percent = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_instance_size_slug.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_instance_size_slug.cs new file mode 100644 index 0000000..4690bbc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_instance_size_slug.cs @@ -0,0 +1,67 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb` + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum App_worker_spec_instance_size_slug + { + [EnumMember(Value = "apps-s-1vcpu-0.5gb")] + #pragma warning disable CS1591 + AppsS1vcpu05gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-1gb-fixed")] + #pragma warning disable CS1591 + AppsS1vcpu1gbFixed, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-1gb")] + #pragma warning disable CS1591 + AppsS1vcpu1gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-1vcpu-2gb")] + #pragma warning disable CS1591 + AppsS1vcpu2gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-s-2vcpu-4gb")] + #pragma warning disable CS1591 + AppsS2vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-0.5gb")] + #pragma warning disable CS1591 + AppsD1vcpu05gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-1gb")] + #pragma warning disable CS1591 + AppsD1vcpu1gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-2gb")] + #pragma warning disable CS1591 + AppsD1vcpu2gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-1vcpu-4gb")] + #pragma warning disable CS1591 + AppsD1vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-2vcpu-4gb")] + #pragma warning disable CS1591 + AppsD2vcpu4gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-2vcpu-8gb")] + #pragma warning disable CS1591 + AppsD2vcpu8gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-4vcpu-8gb")] + #pragma warning disable CS1591 + AppsD4vcpu8gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-4vcpu-16gb")] + #pragma warning disable CS1591 + AppsD4vcpu16gb, + #pragma warning restore CS1591 + [EnumMember(Value = "apps-d-8vcpu-32gb")] + #pragma warning disable CS1591 + AppsD8vcpu32gb, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_termination.cs b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_termination.cs new file mode 100644 index 0000000..6663c86 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/App_worker_spec_termination.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class App_worker_spec_termination : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120) + public int? GracePeriodSeconds { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public App_worker_spec_termination() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_termination CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.App_worker_spec_termination(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "grace_period_seconds", n => { GracePeriodSeconds = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("grace_period_seconds", GracePeriodSeconds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_alert_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_alert_response.cs new file mode 100644 index 0000000..c87f840 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_alert_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_alert_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alert property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert? Alert { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_alert Alert { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_alert_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_alert_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_alert_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alert", n => { Alert = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_alert.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alert", Alert); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_assign_app_alert_destinations_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_assign_app_alert_destinations_request.cs new file mode 100644 index 0000000..1cc6d30 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_assign_app_alert_destinations_request.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_assign_app_alert_destinations_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The emails property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Emails { get; set; } +#nullable restore +#else + public List Emails { get; set; } +#endif + /// The slack_webhooks property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SlackWebhooks { get; set; } +#nullable restore +#else + public List SlackWebhooks { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_assign_app_alert_destinations_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_assign_app_alert_destinations_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_assign_app_alert_destinations_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "emails", n => { Emails = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "slack_webhooks", n => { SlackWebhooks = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_alert_slack_webhook.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("emails", Emails); + writer.WriteCollectionOfObjectValues("slack_webhooks", SlackWebhooks); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_cors_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_cors_policy.cs new file mode 100644 index 0000000..ed570df --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_cors_policy.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_cors_policy : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Whether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include. This configures the `Access-Control-Allow-Credentials` header. + public bool? AllowCredentials { get; set; } + /// The set of allowed HTTP request headers. This configures the `Access-Control-Allow-Headers` header. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AllowHeaders { get; set; } +#nullable restore +#else + public List AllowHeaders { get; set; } +#endif + /// The set of allowed HTTP methods. This configures the `Access-Control-Allow-Methods` header. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AllowMethods { get; set; } +#nullable restore +#else + public List AllowMethods { get; set; } +#endif + /// The set of allowed CORS origins. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AllowOrigins { get; set; } +#nullable restore +#else + public List AllowOrigins { get; set; } +#endif + /// The set of HTTP response headers that browsers are allowed to access. This configures the `Access-Control-Expose-Headers` header. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ExposeHeaders { get; set; } +#nullable restore +#else + public List ExposeHeaders { get; set; } +#endif + /// An optional duration specifying how long browsers can cache the results of a preflight request. This configures the `Access-Control-Max-Age` header. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MaxAge { get; set; } +#nullable restore +#else + public string MaxAge { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_cors_policy() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_cors_policy(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allow_credentials", n => { AllowCredentials = n.GetBoolValue(); } }, + { "allow_headers", n => { AllowHeaders = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "allow_methods", n => { AllowMethods = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "allow_origins", n => { AllowOrigins = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_string_match.CreateFromDiscriminatorValue)?.AsList(); } }, + { "expose_headers", n => { ExposeHeaders = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "max_age", n => { MaxAge = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("allow_credentials", AllowCredentials); + writer.WriteCollectionOfPrimitiveValues("allow_headers", AllowHeaders); + writer.WriteCollectionOfPrimitiveValues("allow_methods", AllowMethods); + writer.WriteCollectionOfObjectValues("allow_origins", AllowOrigins); + writer.WriteCollectionOfPrimitiveValues("expose_headers", ExposeHeaders); + writer.WriteStringValue("max_age", MaxAge); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_create_app_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_create_app_request.cs new file mode 100644 index 0000000..35d42da --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_create_app_request.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_create_app_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the project the app should be assigned to. If omitted, it will be assigned to your default project. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProjectId { get; set; } +#nullable restore +#else + public string ProjectId { get; set; } +#endif + /// The desired configuration of an application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec Spec { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_create_app_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_app_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_app_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project_id", n => { ProjectId = n.GetStringValue(); } }, + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_spec.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("project_id", ProjectId); + writer.WriteObjectValue("spec", Spec); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_create_deployment_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_create_deployment_request.cs new file mode 100644 index 0000000..ab4bad3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_create_deployment_request.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_create_deployment_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The force_build property + public bool? ForceBuild { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_create_deployment_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_deployment_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_deployment_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "force_build", n => { ForceBuild = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("force_build", ForceBuild); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_dedicated_egress_ip.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_dedicated_egress_ip.cs new file mode 100644 index 0000000..e04b3a3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_dedicated_egress_ip.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_dedicated_egress_ip : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The ip property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ip { get; set; } +#nullable restore +#else + public string Ip { get; set; } +#endif + /// The status property + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_dedicated_egress_ip_status? Status { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_dedicated_egress_ip() + { + AdditionalData = new Dictionary(); + Status = global::InfinityFlow.DigitalOcean.Client.Models.Apps_dedicated_egress_ip_status.UNKNOWN; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_dedicated_egress_ip CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_dedicated_egress_ip(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "ip", n => { Ip = n.GetStringValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("ip", Ip); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_dedicated_egress_ip_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_dedicated_egress_ip_status.cs new file mode 100644 index 0000000..826b439 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_dedicated_egress_ip_status.cs @@ -0,0 +1,28 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Apps_dedicated_egress_ip_status + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNKNOWN")] + #pragma warning disable CS1591 + UNKNOWN, + #pragma warning restore CS1591 + [EnumMember(Value = "ASSIGNING")] + #pragma warning disable CS1591 + ASSIGNING, + #pragma warning restore CS1591 + [EnumMember(Value = "ASSIGNED")] + #pragma warning disable CS1591 + ASSIGNED, + #pragma warning restore CS1591 + [EnumMember(Value = "REMOVED")] + #pragma warning disable CS1591 + REMOVED, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_delete_app_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_delete_app_response.cs new file mode 100644 index 0000000..76331cb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_delete_app_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_delete_app_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_delete_app_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_delete_app_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_delete_app_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment.cs new file mode 100644 index 0000000..1341336 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment.cs @@ -0,0 +1,181 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cause property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Cause { get; set; } +#nullable restore +#else + public string Cause { get; set; } +#endif + /// The cloned_from property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClonedFrom { get; set; } +#nullable restore +#else + public string ClonedFrom { get; set; } +#endif + /// The created_at property + public DateTimeOffset? CreatedAt { get; set; } + /// The functions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Functions { get; set; } +#nullable restore +#else + public List Functions { get; set; } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The jobs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Jobs { get; set; } +#nullable restore +#else + public List Jobs { get; set; } +#endif + /// The phase property + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_phase? Phase { get; set; } + /// The phase_last_updated_at property + public DateTimeOffset? PhaseLastUpdatedAt { get; set; } + /// The progress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress? Progress { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress Progress { get; set; } +#endif + /// The services property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Services { get; set; } +#nullable restore +#else + public List Services { get; set; } +#endif + /// The desired configuration of an application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec Spec { get; set; } +#endif + /// The static_sites property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? StaticSites { get; set; } +#nullable restore +#else + public List StaticSites { get; set; } +#endif + /// The tier_slug property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TierSlug { get; private set; } +#nullable restore +#else + public string TierSlug { get; private set; } +#endif + /// The updated_at property + public DateTimeOffset? UpdatedAt { get; set; } + /// The workers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Workers { get; set; } +#nullable restore +#else + public List Workers { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment() + { + AdditionalData = new Dictionary(); + Phase = global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_phase.UNKNOWN; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cause", n => { Cause = n.GetStringValue(); } }, + { "cloned_from", n => { ClonedFrom = n.GetStringValue(); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "functions", n => { Functions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_functions.CreateFromDiscriminatorValue)?.AsList(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "jobs", n => { Jobs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_job.CreateFromDiscriminatorValue)?.AsList(); } }, + { "phase", n => { Phase = n.GetEnumValue(); } }, + { "phase_last_updated_at", n => { PhaseLastUpdatedAt = n.GetDateTimeOffsetValue(); } }, + { "progress", n => { Progress = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress.CreateFromDiscriminatorValue); } }, + { "services", n => { Services = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_service.CreateFromDiscriminatorValue)?.AsList(); } }, + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_spec.CreateFromDiscriminatorValue); } }, + { "static_sites", n => { StaticSites = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_static_site.CreateFromDiscriminatorValue)?.AsList(); } }, + { "tier_slug", n => { TierSlug = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + { "workers", n => { Workers = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_worker.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cause", Cause); + writer.WriteStringValue("cloned_from", ClonedFrom); + writer.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteCollectionOfObjectValues("functions", Functions); + writer.WriteStringValue("id", Id); + writer.WriteCollectionOfObjectValues("jobs", Jobs); + writer.WriteEnumValue("phase", Phase); + writer.WriteDateTimeOffsetValue("phase_last_updated_at", PhaseLastUpdatedAt); + writer.WriteObjectValue("progress", Progress); + writer.WriteCollectionOfObjectValues("services", Services); + writer.WriteObjectValue("spec", Spec); + writer.WriteCollectionOfObjectValues("static_sites", StaticSites); + writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); + writer.WriteCollectionOfObjectValues("workers", Workers); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_functions.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_functions.cs new file mode 100644 index 0000000..49ce083 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_functions.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_functions : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The namespace where the functions are deployed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Namespace { get; set; } +#nullable restore +#else + public string Namespace { get; set; } +#endif + /// The commit hash of the repository that was used to build this functions component. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceCommitHash { get; set; } +#nullable restore +#else + public string SourceCommitHash { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_functions() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_functions CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_functions(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "namespace", n => { Namespace = n.GetStringValue(); } }, + { "source_commit_hash", n => { SourceCommitHash = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("namespace", Namespace); + writer.WriteStringValue("source_commit_hash", SourceCommitHash); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_job.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_job.cs new file mode 100644 index 0000000..ec139f4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_job.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_job : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The source_commit_hash property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceCommitHash { get; set; } +#nullable restore +#else + public string SourceCommitHash { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_job() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_job CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_job(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "source_commit_hash", n => { SourceCommitHash = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("source_commit_hash", SourceCommitHash); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_phase.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_phase.cs new file mode 100644 index 0000000..a493b95 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_phase.cs @@ -0,0 +1,48 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Apps_deployment_phase + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNKNOWN")] + #pragma warning disable CS1591 + UNKNOWN, + #pragma warning restore CS1591 + [EnumMember(Value = "PENDING_BUILD")] + #pragma warning disable CS1591 + PENDING_BUILD, + #pragma warning restore CS1591 + [EnumMember(Value = "BUILDING")] + #pragma warning disable CS1591 + BUILDING, + #pragma warning restore CS1591 + [EnumMember(Value = "PENDING_DEPLOY")] + #pragma warning disable CS1591 + PENDING_DEPLOY, + #pragma warning restore CS1591 + [EnumMember(Value = "DEPLOYING")] + #pragma warning disable CS1591 + DEPLOYING, + #pragma warning restore CS1591 + [EnumMember(Value = "ACTIVE")] + #pragma warning disable CS1591 + ACTIVE, + #pragma warning restore CS1591 + [EnumMember(Value = "SUPERSEDED")] + #pragma warning disable CS1591 + SUPERSEDED, + #pragma warning restore CS1591 + [EnumMember(Value = "ERROR")] + #pragma warning disable CS1591 + ERROR, + #pragma warning restore CS1591 + [EnumMember(Value = "CANCELED")] + #pragma warning disable CS1591 + CANCELED, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress.cs new file mode 100644 index 0000000..ff73e8d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_progress : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The error_steps property + public int? ErrorSteps { get; set; } + /// The pending_steps property + public int? PendingSteps { get; set; } + /// The running_steps property + public int? RunningSteps { get; set; } + /// The steps property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Steps { get; set; } +#nullable restore +#else + public List Steps { get; set; } +#endif + /// The success_steps property + public int? SuccessSteps { get; set; } + /// The summary_steps property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SummarySteps { get; set; } +#nullable restore +#else + public List SummarySteps { get; set; } +#endif + /// The total_steps property + public int? TotalSteps { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_progress() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "error_steps", n => { ErrorSteps = n.GetIntValue(); } }, + { "pending_steps", n => { PendingSteps = n.GetIntValue(); } }, + { "running_steps", n => { RunningSteps = n.GetIntValue(); } }, + { "steps", n => { Steps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step.CreateFromDiscriminatorValue)?.AsList(); } }, + { "success_steps", n => { SuccessSteps = n.GetIntValue(); } }, + { "summary_steps", n => { SummarySteps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step.CreateFromDiscriminatorValue)?.AsList(); } }, + { "total_steps", n => { TotalSteps = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("error_steps", ErrorSteps); + writer.WriteIntValue("pending_steps", PendingSteps); + writer.WriteIntValue("running_steps", RunningSteps); + writer.WriteCollectionOfObjectValues("steps", Steps); + writer.WriteIntValue("success_steps", SuccessSteps); + writer.WriteCollectionOfObjectValues("summary_steps", SummarySteps); + writer.WriteIntValue("total_steps", TotalSteps); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step.cs new file mode 100644 index 0000000..390da4a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step.cs @@ -0,0 +1,118 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_progress_step : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The component_name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ComponentName { get; set; } +#nullable restore +#else + public string ComponentName { get; set; } +#endif + /// The ended_at property + public DateTimeOffset? EndedAt { get; set; } + /// The base of a human-readable description of the step intended to be combined with the component name for presentation. For example:`message_base` = "Building service"`component_name` = "api" +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MessageBase { get; set; } +#nullable restore +#else + public string MessageBase { get; set; } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The reason property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_reason? Reason { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_reason Reason { get; set; } +#endif + /// The started_at property + public DateTimeOffset? StartedAt { get; set; } + /// The status property + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_status? Status { get; set; } + /// The steps property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Steps { get; set; } +#nullable restore +#else + public List Steps { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_progress_step() + { + AdditionalData = new Dictionary(); + Status = global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_status.UNKNOWN; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "component_name", n => { ComponentName = n.GetStringValue(); } }, + { "ended_at", n => { EndedAt = n.GetDateTimeOffsetValue(); } }, + { "message_base", n => { MessageBase = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "reason", n => { Reason = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_reason.CreateFromDiscriminatorValue); } }, + { "started_at", n => { StartedAt = n.GetDateTimeOffsetValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "steps", n => { Steps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_steps.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("component_name", ComponentName); + writer.WriteDateTimeOffsetValue("ended_at", EndedAt); + writer.WriteStringValue("message_base", MessageBase); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("reason", Reason); + writer.WriteDateTimeOffsetValue("started_at", StartedAt); + writer.WriteEnumValue("status", Status); + writer.WriteCollectionOfObjectValues("steps", Steps); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_reason.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_reason.cs new file mode 100644 index 0000000..8e9e09e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_reason.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_progress_step_reason : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The code property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Code { get; set; } +#nullable restore +#else + public string Code { get; set; } +#endif + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_progress_step_reason() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_reason CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_reason(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "code", n => { Code = n.GetStringValue(); } }, + { "message", n => { Message = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("code", Code); + writer.WriteStringValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_status.cs new file mode 100644 index 0000000..300b63a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_status.cs @@ -0,0 +1,32 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Apps_deployment_progress_step_status + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNKNOWN")] + #pragma warning disable CS1591 + UNKNOWN, + #pragma warning restore CS1591 + [EnumMember(Value = "PENDING")] + #pragma warning disable CS1591 + PENDING, + #pragma warning restore CS1591 + [EnumMember(Value = "RUNNING")] + #pragma warning disable CS1591 + RUNNING, + #pragma warning restore CS1591 + [EnumMember(Value = "ERROR")] + #pragma warning disable CS1591 + ERROR, + #pragma warning restore CS1591 + [EnumMember(Value = "SUCCESS")] + #pragma warning disable CS1591 + SUCCESS, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_steps.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_steps.cs new file mode 100644 index 0000000..851581a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_progress_step_steps.cs @@ -0,0 +1,55 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_progress_step_steps : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_progress_step_steps() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_steps CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_progress_step_steps(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_response.cs new file mode 100644 index 0000000..2d58cc8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deployment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment? Deployment { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment Deployment { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "deployment", n => { Deployment = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("deployment", Deployment); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_service.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_service.cs new file mode 100644 index 0000000..195a59d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_service.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_service : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The source_commit_hash property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceCommitHash { get; set; } +#nullable restore +#else + public string SourceCommitHash { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_service() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_service CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_service(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "source_commit_hash", n => { SourceCommitHash = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("source_commit_hash", SourceCommitHash); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_static_site.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_static_site.cs new file mode 100644 index 0000000..67eb36f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_static_site.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_static_site : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The source_commit_hash property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceCommitHash { get; set; } +#nullable restore +#else + public string SourceCommitHash { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_static_site() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_static_site CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_static_site(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "source_commit_hash", n => { SourceCommitHash = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("source_commit_hash", SourceCommitHash); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_worker.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_worker.cs new file mode 100644 index 0000000..aaa887d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployment_worker.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployment_worker : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The source_commit_hash property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceCommitHash { get; set; } +#nullable restore +#else + public string SourceCommitHash { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployment_worker() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_worker CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_worker(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "source_commit_hash", n => { SourceCommitHash = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("source_commit_hash", SourceCommitHash); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployments_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployments_response.cs new file mode 100644 index 0000000..d64f6ea --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_deployments_response.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_deployments_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deployments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Deployments { get; set; } +#nullable restore +#else + public List Deployments { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_deployments_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployments_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployments_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "deployments", n => { Deployments = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("deployments", Deployments); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain.cs new file mode 100644 index 0000000..2b24fb7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain.cs @@ -0,0 +1,106 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_domain : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The certificate_expires_at property + public DateTimeOffset? CertificateExpiresAt { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The phase property + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_phase? Phase { get; set; } + /// The progress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress? Progress { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress Progress { get; set; } +#endif + /// The rotate_validation_records property + public bool? RotateValidationRecords { get; private set; } + /// The spec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec Spec { get; set; } +#endif + /// The validations property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Validations { get; set; } +#nullable restore +#else + public List Validations { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_domain() + { + AdditionalData = new Dictionary(); + Phase = global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_phase.UNKNOWN; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate_expires_at", n => { CertificateExpiresAt = n.GetDateTimeOffsetValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "phase", n => { Phase = n.GetEnumValue(); } }, + { "progress", n => { Progress = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress.CreateFromDiscriminatorValue); } }, + { "rotate_validation_records", n => { RotateValidationRecords = n.GetBoolValue(); } }, + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_domain_spec.CreateFromDiscriminatorValue); } }, + { "validations", n => { Validations = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_domain_validation.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("phase", Phase); + writer.WriteObjectValue("progress", Progress); + writer.WriteObjectValue("spec", Spec); + writer.WriteCollectionOfObjectValues("validations", Validations); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_phase.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_phase.cs new file mode 100644 index 0000000..888cb5d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_phase.cs @@ -0,0 +1,32 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Apps_domain_phase + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNKNOWN")] + #pragma warning disable CS1591 + UNKNOWN, + #pragma warning restore CS1591 + [EnumMember(Value = "PENDING")] + #pragma warning disable CS1591 + PENDING, + #pragma warning restore CS1591 + [EnumMember(Value = "CONFIGURING")] + #pragma warning disable CS1591 + CONFIGURING, + #pragma warning restore CS1591 + [EnumMember(Value = "ACTIVE")] + #pragma warning disable CS1591 + ACTIVE, + #pragma warning restore CS1591 + [EnumMember(Value = "ERROR")] + #pragma warning disable CS1591 + ERROR, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_progress.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_progress.cs new file mode 100644 index 0000000..3f731fc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_progress.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_domain_progress : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The steps property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Steps { get; set; } +#nullable restore +#else + public List Steps { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_domain_progress() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "steps", n => { Steps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress_steps.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("steps", Steps); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_progress_steps.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_progress_steps.cs new file mode 100644 index 0000000..642604d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_domain_progress_steps.cs @@ -0,0 +1,55 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_domain_progress_steps : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_domain_progress_steps() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress_steps CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_domain_progress_steps(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_exec_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_exec_response.cs new file mode 100644 index 0000000..6757cf9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_exec_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_get_exec_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A websocket URL that allows sending/receiving console input and receiving console output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_get_exec_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_exec_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_exec_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_instance_size_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_instance_size_response.cs new file mode 100644 index 0000000..8226fc9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_instance_size_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_get_instance_size_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The instance_size property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_instance_size? InstanceSize { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_instance_size InstanceSize { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_get_instance_size_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_instance_size_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_instance_size_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "instance_size", n => { InstanceSize = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_instance_size.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("instance_size", InstanceSize); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_logs_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_logs_response.cs new file mode 100644 index 0000000..97723cf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_get_logs_response.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_get_logs_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The historic_urls property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? HistoricUrls { get; set; } +#nullable restore +#else + public List HistoricUrls { get; set; } +#endif + /// A URL of the real-time live logs. This URL may use either the `https://` or `wss://` protocols and will keep pushing live logs as they become available. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveUrl { get; set; } +#nullable restore +#else + public string LiveUrl { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_get_logs_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_logs_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_logs_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "historic_urls", n => { HistoricUrls = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "live_url", n => { LiveUrl = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("historic_urls", HistoricUrls); + writer.WriteStringValue("live_url", LiveUrl); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_git_source_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_git_source_spec.cs new file mode 100644 index 0000000..6b58966 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_git_source_spec.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_git_source_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the branch to use +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Branch { get; set; } +#nullable restore +#else + public string Branch { get; set; } +#endif + /// The clone URL of the repo. Example: `https://github.com/digitalocean/sample-golang.git` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RepoCloneUrl { get; set; } +#nullable restore +#else + public string RepoCloneUrl { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_git_source_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_git_source_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "branch", n => { Branch = n.GetStringValue(); } }, + { "repo_clone_url", n => { RepoCloneUrl = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("branch", Branch); + writer.WriteStringValue("repo_clone_url", RepoCloneUrl); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_github_source_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_github_source_spec.cs new file mode 100644 index 0000000..72495fe --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_github_source_spec.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_github_source_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the branch to use +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Branch { get; set; } +#nullable restore +#else + public string Branch { get; set; } +#endif + /// Whether to automatically deploy new commits made to the repo + public bool? DeployOnPush { get; set; } + /// The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Repo { get; set; } +#nullable restore +#else + public string Repo { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_github_source_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_github_source_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "branch", n => { Branch = n.GetStringValue(); } }, + { "deploy_on_push", n => { DeployOnPush = n.GetBoolValue(); } }, + { "repo", n => { Repo = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("branch", Branch); + writer.WriteBoolValue("deploy_on_push", DeployOnPush); + writer.WriteStringValue("repo", Repo); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_gitlab_source_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_gitlab_source_spec.cs new file mode 100644 index 0000000..c115182 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_gitlab_source_spec.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_gitlab_source_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the branch to use +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Branch { get; set; } +#nullable restore +#else + public string Branch { get; set; } +#endif + /// Whether to automatically deploy new commits made to the repo + public bool? DeployOnPush { get; set; } + /// The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Repo { get; set; } +#nullable restore +#else + public string Repo { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_gitlab_source_spec() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_gitlab_source_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "branch", n => { Branch = n.GetStringValue(); } }, + { "deploy_on_push", n => { DeployOnPush = n.GetBoolValue(); } }, + { "repo", n => { Repo = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("branch", Branch); + writer.WriteBoolValue("deploy_on_push", DeployOnPush); + writer.WriteStringValue("repo", Repo); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec.cs new file mode 100644 index 0000000..12d0460 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec.cs @@ -0,0 +1,120 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_image_source_spec : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deploy_on_push property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec_deploy_on_push? DeployOnPush { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec_deploy_on_push DeployOnPush { get; set; } +#endif + /// The image digest. Cannot be specified if tag is provided. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Digest { get; set; } +#nullable restore +#else + public string Digest { get; set; } +#endif + /// The registry name. Must be left empty for the `DOCR` registry type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Registry { get; set; } +#nullable restore +#else + public string Registry { get; set; } +#endif + /// The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.- "$username:$access_token" for registries of type `DOCKER_HUB`.- "$username:$access_token" for registries of type `GHCR`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RegistryCredentials { get; set; } +#nullable restore +#else + public string RegistryCredentials { get; set; } +#endif + /// - DOCKER_HUB: The DockerHub container registry type.- DOCR: The DigitalOcean container registry type.- GHCR: The Github container registry type. + public global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec_registry_type? RegistryType { get; set; } + /// The repository name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Repository { get; set; } +#nullable restore +#else + public string Repository { get; set; } +#endif + /// The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Tag { get; set; } +#nullable restore +#else + public string Tag { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_image_source_spec() + { + AdditionalData = new Dictionary(); + Tag = "latest"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "deploy_on_push", n => { DeployOnPush = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec_deploy_on_push.CreateFromDiscriminatorValue); } }, + { "digest", n => { Digest = n.GetStringValue(); } }, + { "registry", n => { Registry = n.GetStringValue(); } }, + { "registry_credentials", n => { RegistryCredentials = n.GetStringValue(); } }, + { "registry_type", n => { RegistryType = n.GetEnumValue(); } }, + { "repository", n => { Repository = n.GetStringValue(); } }, + { "tag", n => { Tag = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("deploy_on_push", DeployOnPush); + writer.WriteStringValue("digest", Digest); + writer.WriteStringValue("registry", Registry); + writer.WriteStringValue("registry_credentials", RegistryCredentials); + writer.WriteEnumValue("registry_type", RegistryType); + writer.WriteStringValue("repository", Repository); + writer.WriteStringValue("tag", Tag); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec_deploy_on_push.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec_deploy_on_push.cs new file mode 100644 index 0000000..e0cdb9d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec_deploy_on_push.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_image_source_spec_deploy_on_push : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Whether to automatically deploy new images. Can only be used for images hosted in DOCR and can only be used with an image tag, not a specific digest. + public bool? Enabled { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_image_source_spec_deploy_on_push() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec_deploy_on_push CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_image_source_spec_deploy_on_push(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enabled", n => { Enabled = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("enabled", Enabled); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec_registry_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec_registry_type.cs new file mode 100644 index 0000000..8af0280 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_image_source_spec_registry_type.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// - DOCKER_HUB: The DockerHub container registry type.- DOCR: The DigitalOcean container registry type.- GHCR: The Github container registry type. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Apps_image_source_spec_registry_type + { + [EnumMember(Value = "DOCKER_HUB")] + #pragma warning disable CS1591 + DOCKER_HUB, + #pragma warning restore CS1591 + [EnumMember(Value = "DOCR")] + #pragma warning disable CS1591 + DOCR, + #pragma warning restore CS1591 + [EnumMember(Value = "GHCR")] + #pragma warning disable CS1591 + GHCR, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_instance_size.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_instance_size.cs new file mode 100644 index 0000000..81e468a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_instance_size.cs @@ -0,0 +1,174 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_instance_size : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The bandwidth_allowance_gib property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BandwidthAllowanceGib { get; set; } +#nullable restore +#else + public string BandwidthAllowanceGib { get; set; } +#endif + /// The cpus property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Cpus { get; set; } +#nullable restore +#else + public string Cpus { get; set; } +#endif + /// The cpu_type property + public global::InfinityFlow.DigitalOcean.Client.Models.Instance_size_cpu_type? CpuType { get; set; } + /// The deprecation_intent property + public bool? DeprecationIntent { get; set; } + /// The memory_bytes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MemoryBytes { get; set; } +#nullable restore +#else + public string MemoryBytes { get; set; } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The scalable property + public bool? Scalable { get; set; } + /// The single_instance_only property + public bool? SingleInstanceOnly { get; set; } + /// The slug property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// The tier_downgrade_to property + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TierDowngradeTo { get; set; } +#nullable restore +#else + public string TierDowngradeTo { get; set; } +#endif + /// The tier_slug property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TierSlug { get; set; } +#nullable restore +#else + public string TierSlug { get; set; } +#endif + /// The tier_upgrade_to property + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TierUpgradeTo { get; set; } +#nullable restore +#else + public string TierUpgradeTo { get; set; } +#endif + /// The usd_per_month property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UsdPerMonth { get; set; } +#nullable restore +#else + public string UsdPerMonth { get; set; } +#endif + /// The usd_per_second property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UsdPerSecond { get; set; } +#nullable restore +#else + public string UsdPerSecond { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_instance_size() + { + AdditionalData = new Dictionary(); + CpuType = global::InfinityFlow.DigitalOcean.Client.Models.Instance_size_cpu_type.UNSPECIFIED; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_instance_size CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_instance_size(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "bandwidth_allowance_gib", n => { BandwidthAllowanceGib = n.GetStringValue(); } }, + { "cpu_type", n => { CpuType = n.GetEnumValue(); } }, + { "cpus", n => { Cpus = n.GetStringValue(); } }, + { "deprecation_intent", n => { DeprecationIntent = n.GetBoolValue(); } }, + { "memory_bytes", n => { MemoryBytes = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "scalable", n => { Scalable = n.GetBoolValue(); } }, + { "single_instance_only", n => { SingleInstanceOnly = n.GetBoolValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + { "tier_downgrade_to", n => { TierDowngradeTo = n.GetStringValue(); } }, + { "tier_slug", n => { TierSlug = n.GetStringValue(); } }, + { "tier_upgrade_to", n => { TierUpgradeTo = n.GetStringValue(); } }, + { "usd_per_month", n => { UsdPerMonth = n.GetStringValue(); } }, + { "usd_per_second", n => { UsdPerSecond = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("bandwidth_allowance_gib", BandwidthAllowanceGib); + writer.WriteEnumValue("cpu_type", CpuType); + writer.WriteStringValue("cpus", Cpus); + writer.WriteBoolValue("deprecation_intent", DeprecationIntent); + writer.WriteStringValue("memory_bytes", MemoryBytes); + writer.WriteStringValue("name", Name); + writer.WriteBoolValue("scalable", Scalable); + writer.WriteBoolValue("single_instance_only", SingleInstanceOnly); + writer.WriteStringValue("slug", Slug); + writer.WriteStringValue("tier_downgrade_to", TierDowngradeTo); + writer.WriteStringValue("tier_slug", TierSlug); + writer.WriteStringValue("tier_upgrade_to", TierUpgradeTo); + writer.WriteStringValue("usd_per_month", UsdPerMonth); + writer.WriteStringValue("usd_per_second", UsdPerSecond); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_alerts_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_alerts_response.cs new file mode 100644 index 0000000..fcdccfc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_alerts_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_list_alerts_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alerts property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Alerts { get; set; } +#nullable restore +#else + public List Alerts { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_list_alerts_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_alerts_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_alerts_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alerts", n => { Alerts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_alert.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("alerts", Alerts); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_instance_sizes_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_instance_sizes_response.cs new file mode 100644 index 0000000..7de5526 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_instance_sizes_response.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_list_instance_sizes_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The discount_percent property + public float? DiscountPercent { get; set; } + /// The instance_sizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? InstanceSizes { get; set; } +#nullable restore +#else + public List InstanceSizes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_list_instance_sizes_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_instance_sizes_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_instance_sizes_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "discount_percent", n => { DiscountPercent = n.GetFloatValue(); } }, + { "instance_sizes", n => { InstanceSizes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_instance_size.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteFloatValue("discount_percent", DiscountPercent); + writer.WriteCollectionOfObjectValues("instance_sizes", InstanceSizes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_regions_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_regions_response.cs new file mode 100644 index 0000000..61580d2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_list_regions_response.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_list_regions_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The regions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_list_regions_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_regions_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_regions_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "regions", n => { Regions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Apps_region.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("regions", Regions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_region.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_region.cs new file mode 100644 index 0000000..b960217 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_region.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_region : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The continent property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Continent { get; private set; } +#nullable restore +#else + public string Continent { get; private set; } +#endif + /// The data_centers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DataCenters { get; private set; } +#nullable restore +#else + public List DataCenters { get; private set; } +#endif + /// Whether or not the region is presented as the default. + public bool? Default { get; private set; } + /// The disabled property + public bool? Disabled { get; private set; } + /// The flag property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Flag { get; private set; } +#nullable restore +#else + public string Flag { get; private set; } +#endif + /// The label property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Label { get; private set; } +#nullable restore +#else + public string Label { get; private set; } +#endif + /// The reason property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Reason { get; private set; } +#nullable restore +#else + public string Reason { get; private set; } +#endif + /// The slug property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; private set; } +#nullable restore +#else + public string Slug { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_region() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_region CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_region(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "continent", n => { Continent = n.GetStringValue(); } }, + { "data_centers", n => { DataCenters = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "default", n => { Default = n.GetBoolValue(); } }, + { "disabled", n => { Disabled = n.GetBoolValue(); } }, + { "flag", n => { Flag = n.GetStringValue(); } }, + { "label", n => { Label = n.GetStringValue(); } }, + { "reason", n => { Reason = n.GetStringValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_response.cs new file mode 100644 index 0000000..85644d4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_response.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The apps property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Apps { get; set; } +#nullable restore +#else + public List Apps { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "apps", n => { Apps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("apps", Apps); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_restart_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_restart_request.cs new file mode 100644 index 0000000..af9c0da --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_restart_request.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_restart_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The components property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Components { get; set; } +#nullable restore +#else + public List Components { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_restart_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_restart_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_restart_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "components", n => { Components = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("components", Components); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_rollback_app_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_rollback_app_request.cs new file mode 100644 index 0000000..806c12f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_rollback_app_request.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_rollback_app_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the deployment to rollback to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeploymentId { get; set; } +#nullable restore +#else + public string DeploymentId { get; set; } +#endif + /// Whether to skip pinning the rollback deployment. If false, the rollback deployment will be pinned and any new deployments including Auto Deploy on Push hooks will be disabled until the rollback is either manually committed or reverted via the CommitAppRollback or RevertAppRollback endpoints respectively. If true, the rollback will be immediately committed and the app will remain unpinned. + public bool? SkipPin { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_rollback_app_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "deployment_id", n => { DeploymentId = n.GetStringValue(); } }, + { "skip_pin", n => { SkipPin = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("deployment_id", DeploymentId); + writer.WriteBoolValue("skip_pin", SkipPin); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_string_match.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_string_match.cs new file mode 100644 index 0000000..b3f4bad --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_string_match.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_string_match : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Exact { get; set; } +#nullable restore +#else + public string Exact { get; set; } +#endif + /// Prefix-based match. Only 1 of `exact`, `prefix`, or `regex` must be set. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Prefix { get; set; } +#nullable restore +#else + public string Prefix { get; set; } +#endif + /// RE2 style regex-based match. Only 1 of `exact`, `prefix`, or `regex` must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Regex { get; set; } +#nullable restore +#else + public string Regex { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Apps_string_match() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_string_match CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_string_match(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "exact", n => { Exact = n.GetStringValue(); } }, + { "prefix", n => { Prefix = n.GetStringValue(); } }, + { "regex", n => { Regex = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("exact", Exact); + writer.WriteStringValue("prefix", Prefix); + writer.WriteStringValue("regex", Regex); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Apps_update_app_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_update_app_request.cs new file mode 100644 index 0000000..bac8b2e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Apps_update_app_request.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Apps_update_app_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The desired configuration of an application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec? Spec { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_spec Spec { get; set; } +#endif + /// Whether or not to update the source versions (for example fetching a new commit or image digest) of all components. By default (when this is false) only newly added sources will be updated to avoid changes like updating the scale of a component from also updating the respective code. + public bool? UpdateAllSourceVersions { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Apps_update_app_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Apps_update_app_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Apps_update_app_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "spec", n => { Spec = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_spec.CreateFromDiscriminatorValue); } }, + { "update_all_source_versions", n => { UpdateAllSourceVersions = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("spec", Spec); + writer.WriteBoolValue("update_all_source_versions", UpdateAllSourceVersions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Associated_kubernetes_resource.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_kubernetes_resource.cs new file mode 100644 index 0000000..6e7ab68 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_kubernetes_resource.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Associated_kubernetes_resource : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of a resource associated with a Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The name of a resource associated with a Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Associated_kubernetes_resource() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Associated_kubernetes_resources.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_kubernetes_resources.cs new file mode 100644 index 0000000..d5baac2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_kubernetes_resources.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing the IDs of resources associated with a Kubernetes cluster. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Associated_kubernetes_resources : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of names and IDs for associated load balancers that can be destroyed along with the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LoadBalancers { get; set; } +#nullable restore +#else + public List LoadBalancers { get; set; } +#endif + /// A list of names and IDs for associated volumes that can be destroyed along with the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Volumes { get; set; } +#nullable restore +#else + public List Volumes { get; set; } +#endif + /// A list of names and IDs for associated volume snapshots that can be destroyed along with the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VolumeSnapshots { get; set; } +#nullable restore +#else + public List VolumeSnapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Associated_kubernetes_resources() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resources CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resources(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "load_balancers", n => { LoadBalancers = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "volume_snapshots", n => { VolumeSnapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "volumes", n => { Volumes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("load_balancers", LoadBalancers); + writer.WriteCollectionOfObjectValues("volume_snapshots", VolumeSnapshots); + writer.WriteCollectionOfObjectValues("volumes", Volumes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource.cs new file mode 100644 index 0000000..aa0a37e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An objects containing information about a resource associated with a Droplet. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Associated_resource : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Cost { get; set; } +#nullable restore +#else + public string Cost { get; set; } +#endif + /// The unique identifier for the resource associated with the Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The name of the resource associated with the Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Associated_resource() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cost", n => { Cost = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cost", Cost); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource_status.cs new file mode 100644 index 0000000..2c72205 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource_status.cs @@ -0,0 +1,84 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An objects containing information about a resources scheduled for deletion. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Associated_resource_status : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format indicating when the requested action was completed. + public DateTimeOffset? CompletedAt { get; set; } + /// An object containing information about a resource scheduled for deletion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource? Droplet { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource Droplet { get; set; } +#endif + /// A count of the associated resources that failed to be destroyed, if any. + public int? Failures { get; set; } + /// An object containing additional information about resource related to a Droplet requested to be destroyed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status_resources? Resources { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status_resources Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Associated_resource_status() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "completed_at", n => { CompletedAt = n.GetDateTimeOffsetValue(); } }, + { "droplet", n => { Droplet = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource.CreateFromDiscriminatorValue); } }, + { "failures", n => { Failures = n.GetIntValue(); } }, + { "resources", n => { Resources = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status_resources.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("completed_at", CompletedAt); + writer.WriteObjectValue("droplet", Droplet); + writer.WriteIntValue("failures", Failures); + writer.WriteObjectValue("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource_status_resources.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource_status_resources.cs new file mode 100644 index 0000000..ac07891 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Associated_resource_status_resources.cs @@ -0,0 +1,106 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing additional information about resource related to a Droplet requested to be destroyed. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Associated_resource_status_resources : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The floating_ips property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FloatingIps { get; set; } +#nullable restore +#else + public List FloatingIps { get; set; } +#endif + /// The reserved_ips property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ReservedIps { get; set; } +#nullable restore +#else + public List ReservedIps { get; set; } +#endif + /// The snapshots property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Snapshots { get; set; } +#nullable restore +#else + public List Snapshots { get; set; } +#endif + /// The volumes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Volumes { get; set; } +#nullable restore +#else + public List Volumes { get; set; } +#endif + /// The volume_snapshots property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VolumeSnapshots { get; set; } +#nullable restore +#else + public List VolumeSnapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Associated_resource_status_resources() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status_resources CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status_resources(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "floating_ips", n => { FloatingIps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "reserved_ips", n => { ReservedIps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "snapshots", n => { Snapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "volume_snapshots", n => { VolumeSnapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "volumes", n => { Volumes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("floating_ips", FloatingIps); + writer.WriteCollectionOfObjectValues("reserved_ips", ReservedIps); + writer.WriteCollectionOfObjectValues("snapshots", Snapshots); + writer.WriteCollectionOfObjectValues("volume_snapshots", VolumeSnapshots); + writer.WriteCollectionOfObjectValues("volumes", Volumes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Backup.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Backup.cs new file mode 100644 index 0000000..c448583 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Backup.cs @@ -0,0 +1,63 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Backup : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format at which the backup was created. + public DateTimeOffset? CreatedAt { get; set; } + /// The size of the database backup in GBs. + public double? SizeGigabytes { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Backup() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Backup CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Backup(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "size_gigabytes", n => { SizeGigabytes = n.GetDoubleValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteDoubleValue("size_gigabytes", SizeGigabytes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Backward_links.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Backward_links.cs new file mode 100644 index 0000000..e6056ed --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Backward_links.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Backward_links : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// URI of the first page of the results. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? First { get; set; } +#nullable restore +#else + public string First { get; set; } +#endif + /// URI of the previous page of the results. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Prev { get; set; } +#nullable restore +#else + public string Prev { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Backward_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Backward_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Backward_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "first", n => { First = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("first", First); + writer.WriteStringValue("prev", Prev); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Balance.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Balance.cs new file mode 100644 index 0000000..c8a28e6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Balance.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Balance : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Current balance of the customer's most recent billing activity. Does not reflect `month_to_date_usage`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AccountBalance { get; set; } +#nullable restore +#else + public string AccountBalance { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The time at which balances were most recently generated. + public DateTimeOffset? GeneratedAt { get; set; } + /// Balance as of the `generated_at` time. This value includes the `account_balance` and `month_to_date_usage`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MonthToDateBalance { get; set; } +#nullable restore +#else + public string MonthToDateBalance { get; set; } +#endif + /// Amount used in the current billing period as of the `generated_at` time. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MonthToDateUsage { get; set; } +#nullable restore +#else + public string MonthToDateUsage { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Balance() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Balance CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Balance(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "account_balance", n => { AccountBalance = n.GetStringValue(); } }, + { "generated_at", n => { GeneratedAt = n.GetDateTimeOffsetValue(); } }, + { "month_to_date_balance", n => { MonthToDateBalance = n.GetStringValue(); } }, + { "month_to_date_usage", n => { MonthToDateUsage = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("account_balance", AccountBalance); + writer.WriteDateTimeOffsetValue("generated_at", GeneratedAt); + writer.WriteStringValue("month_to_date_balance", MonthToDateBalance); + writer.WriteStringValue("month_to_date_usage", MonthToDateUsage); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Billing_address.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Billing_address.cs new file mode 100644 index 0000000..cc22673 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Billing_address.cs @@ -0,0 +1,135 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Billing_address : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Street address line 1 +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AddressLine1 { get; set; } +#nullable restore +#else + public string AddressLine1 { get; set; } +#endif + /// Street address line 2 +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AddressLine2 { get; set; } +#nullable restore +#else + public string AddressLine2 { get; set; } +#endif + /// City +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? City { get; set; } +#nullable restore +#else + public string City { get; set; } +#endif + /// Country (ISO2) code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CountryIso2Code { get; set; } +#nullable restore +#else + public string CountryIso2Code { get; set; } +#endif + /// Timestamp billing address was created +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; set; } +#nullable restore +#else + public string CreatedAt { get; set; } +#endif + /// Postal code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PostalCode { get; set; } +#nullable restore +#else + public string PostalCode { get; set; } +#endif + /// Region +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// Timestamp billing address was updated +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UpdatedAt { get; set; } +#nullable restore +#else + public string UpdatedAt { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Billing_address() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Billing_address CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Billing_address(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "address_line1", n => { AddressLine1 = n.GetStringValue(); } }, + { "address_line2", n => { AddressLine2 = n.GetStringValue(); } }, + { "city", n => { City = n.GetStringValue(); } }, + { "country_iso2_code", n => { CountryIso2Code = n.GetStringValue(); } }, + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "postal_code", n => { PostalCode = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("address_line1", AddressLine1); + writer.WriteStringValue("address_line2", AddressLine2); + writer.WriteStringValue("city", City); + writer.WriteStringValue("country_iso2_code", CountryIso2Code); + writer.WriteStringValue("created_at", CreatedAt); + writer.WriteStringValue("postal_code", PostalCode); + writer.WriteStringValue("region", Region); + writer.WriteStringValue("updated_at", UpdatedAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Billing_history.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Billing_history.cs new file mode 100644 index 0000000..28cd925 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Billing_history.cs @@ -0,0 +1,103 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Billing_history : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Amount of the billing history entry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Amount { get; set; } +#nullable restore +#else + public string Amount { get; set; } +#endif + /// Time the billing history entry occurred. + public DateTimeOffset? Date { get; set; } + /// Description of the billing history entry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// ID of the invoice associated with the billing history entry, if applicable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InvoiceId { get; set; } +#nullable restore +#else + public string InvoiceId { get; set; } +#endif + /// UUID of the invoice associated with the billing history entry, if applicable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InvoiceUuid { get; set; } +#nullable restore +#else + public string InvoiceUuid { get; set; } +#endif + /// Type of billing history entry. + public global::InfinityFlow.DigitalOcean.Client.Models.Billing_history_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Billing_history() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Billing_history CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Billing_history(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetStringValue(); } }, + { "date", n => { Date = n.GetDateTimeOffsetValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "invoice_id", n => { InvoiceId = n.GetStringValue(); } }, + { "invoice_uuid", n => { InvoiceUuid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("amount", Amount); + writer.WriteDateTimeOffsetValue("date", Date); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("invoice_id", InvoiceId); + writer.WriteStringValue("invoice_uuid", InvoiceUuid); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Billing_history_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Billing_history_type.cs new file mode 100644 index 0000000..7b9bc59 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Billing_history_type.cs @@ -0,0 +1,51 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Type of billing history entry. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Billing_history_type + { + [EnumMember(Value = "ACHFailure")] + #pragma warning disable CS1591 + ACHFailure, + #pragma warning restore CS1591 + [EnumMember(Value = "Adjustment")] + #pragma warning disable CS1591 + Adjustment, + #pragma warning restore CS1591 + [EnumMember(Value = "AttemptFailed")] + #pragma warning disable CS1591 + AttemptFailed, + #pragma warning restore CS1591 + [EnumMember(Value = "Chargeback")] + #pragma warning disable CS1591 + Chargeback, + #pragma warning restore CS1591 + [EnumMember(Value = "Credit")] + #pragma warning disable CS1591 + Credit, + #pragma warning restore CS1591 + [EnumMember(Value = "CreditExpiration")] + #pragma warning disable CS1591 + CreditExpiration, + #pragma warning restore CS1591 + [EnumMember(Value = "Invoice")] + #pragma warning disable CS1591 + Invoice, + #pragma warning restore CS1591 + [EnumMember(Value = "Payment")] + #pragma warning disable CS1591 + Payment, + #pragma warning restore CS1591 + [EnumMember(Value = "Refund")] + #pragma warning disable CS1591 + Refund, + #pragma warning restore CS1591 + [EnumMember(Value = "Reversal")] + #pragma warning disable CS1591 + Reversal, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Ca.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Ca.cs new file mode 100644 index 0000000..5e43163 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Ca.cs @@ -0,0 +1,64 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Ca : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// base64 encoding of the certificate used to secure database connections +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Certificate { get; private set; } +#nullable restore +#else + public string Certificate { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Ca() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Ca CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Ca(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate", n => { Certificate = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Cdn_endpoint.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Cdn_endpoint.cs new file mode 100644 index 0000000..3c37763 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Cdn_endpoint.cs @@ -0,0 +1,98 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Cdn_endpoint : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. + public Guid? CertificateId { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the CDN endpoint was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// The fully qualified domain name (FQDN) of the custom subdomain used with the CDN endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CustomDomain { get; set; } +#nullable restore +#else + public string CustomDomain { get; set; } +#endif + /// The fully qualified domain name (FQDN) from which the CDN-backed content is served. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; private set; } +#nullable restore +#else + public string Endpoint { get; private set; } +#endif + /// A unique ID that can be used to identify and reference a CDN endpoint. + public Guid? Id { get; private set; } + /// The fully qualified domain name (FQDN) for the origin server which provides the content for the CDN. This is currently restricted to a Space. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Origin { get; set; } +#nullable restore +#else + public string Origin { get; set; } +#endif + /// The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. + public int? Ttl { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Cdn_endpoint() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate_id", n => { CertificateId = n.GetGuidValue(); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "custom_domain", n => { CustomDomain = n.GetStringValue(); } }, + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "origin", n => { Origin = n.GetStringValue(); } }, + { "ttl", n => { Ttl = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("certificate_id", CertificateId); + writer.WriteStringValue("custom_domain", CustomDomain); + writer.WriteStringValue("origin", Origin); + writer.WriteIntValue("ttl", Ttl); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Certificate.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate.cs new file mode 100644 index 0000000..ca9cc39 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate.cs @@ -0,0 +1,100 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Certificate : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the certificate was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// An array of fully qualified domain names (FQDNs) for which the certificate was issued. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DnsNames { get; set; } +#nullable restore +#else + public List DnsNames { get; set; } +#endif + /// A unique ID that can be used to identify and reference a certificate. + public Guid? Id { get; private set; } + /// A unique human-readable name referring to a certificate. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents the certificate's expiration date. + public DateTimeOffset? NotAfter { get; private set; } + /// A unique identifier generated from the SHA-1 fingerprint of the certificate. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Sha1Fingerprint { get; private set; } +#nullable restore +#else + public string Sha1Fingerprint { get; private set; } +#endif + /// A string representing the current state of the certificate. It may be `pending`, `verified`, or `error`. + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate_state? State { get; private set; } + /// A string representing the type of the certificate. The value will be `custom` for a user-uploaded certificate or `lets_encrypt` for one automatically generated with Let's Encrypt. + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Certificate() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Certificate CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Certificate(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "dns_names", n => { DnsNames = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "not_after", n => { NotAfter = n.GetDateTimeOffsetValue(); } }, + { "sha1_fingerprint", n => { Sha1Fingerprint = n.GetStringValue(); } }, + { "state", n => { State = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("dns_names", DnsNames); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_create_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_create_base.cs new file mode 100644 index 0000000..c154740 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_create_base.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Certificate_create_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A unique human-readable name referring to a certificate. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A string representing the type of the certificate. The value will be `custom` for a user-uploaded certificate or `lets_encrypt` for one automatically generated with Let's Encrypt. + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate_create_base_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Certificate_create_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Certificate_create_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Certificate_create_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_create_base_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_create_base_type.cs new file mode 100644 index 0000000..085a298 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_create_base_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string representing the type of the certificate. The value will be `custom` for a user-uploaded certificate or `lets_encrypt` for one automatically generated with Let's Encrypt. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Certificate_create_base_type + { + [EnumMember(Value = "custom")] + #pragma warning disable CS1591 + Custom, + #pragma warning restore CS1591 + [EnumMember(Value = "lets_encrypt")] + #pragma warning disable CS1591 + Lets_encrypt, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_request_custom.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_request_custom.cs new file mode 100644 index 0000000..cd4ad7b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_request_custom.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Certificate_request_custom : global::InfinityFlow.DigitalOcean.Client.Models.Certificate_create_base, IParsable + #pragma warning restore CS1591 + { + /// The full PEM-formatted trust chain between the certificate authority's certificate and your domain's SSL certificate. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CertificateChain { get; set; } +#nullable restore +#else + public string CertificateChain { get; set; } +#endif + /// The contents of a PEM-formatted public SSL certificate. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LeafCertificate { get; set; } +#nullable restore +#else + public string LeafCertificate { get; set; } +#endif + /// The contents of a PEM-formatted private-key corresponding to the SSL certificate. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PrivateKey { get; set; } +#nullable restore +#else + public string PrivateKey { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_custom CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_custom(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "certificate_chain", n => { CertificateChain = n.GetStringValue(); } }, + { "leaf_certificate", n => { LeafCertificate = n.GetStringValue(); } }, + { "private_key", n => { PrivateKey = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("certificate_chain", CertificateChain); + writer.WriteStringValue("leaf_certificate", LeafCertificate); + writer.WriteStringValue("private_key", PrivateKey); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_request_lets_encrypt.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_request_lets_encrypt.cs new file mode 100644 index 0000000..bd3524b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_request_lets_encrypt.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Certificate_request_lets_encrypt : global::InfinityFlow.DigitalOcean.Client.Models.Certificate_create_base, IParsable + #pragma warning restore CS1591 + { + /// An array of fully qualified domain names (FQDNs) for which the certificate was issued. A certificate covering all subdomains can be issued using a wildcard (e.g. `*.example.com`). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DnsNames { get; set; } +#nullable restore +#else + public List DnsNames { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_lets_encrypt CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_lets_encrypt(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "dns_names", n => { DnsNames = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfPrimitiveValues("dns_names", DnsNames); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_state.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_state.cs new file mode 100644 index 0000000..42ed57b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_state.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string representing the current state of the certificate. It may be `pending`, `verified`, or `error`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Certificate_state + { + [EnumMember(Value = "pending")] + #pragma warning disable CS1591 + Pending, + #pragma warning restore CS1591 + [EnumMember(Value = "verified")] + #pragma warning disable CS1591 + Verified, + #pragma warning restore CS1591 + [EnumMember(Value = "error")] + #pragma warning disable CS1591 + Error, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_type.cs new file mode 100644 index 0000000..2d03868 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Certificate_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string representing the type of the certificate. The value will be `custom` for a user-uploaded certificate or `lets_encrypt` for one automatically generated with Let's Encrypt. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Certificate_type + { + [EnumMember(Value = "custom")] + #pragma warning disable CS1591 + Custom, + #pragma warning restore CS1591 + [EnumMember(Value = "lets_encrypt")] + #pragma warning disable CS1591 + Lets_encrypt, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Check.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Check.cs new file mode 100644 index 0000000..6f60eb2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Check.cs @@ -0,0 +1,96 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Check : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether the check is enabled/disabled. + public bool? Enabled { get; set; } + /// A unique ID that can be used to identify and reference the check. + public Guid? Id { get; private set; } + /// A human-friendly display name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An array containing the selected regions to perform healthchecks from. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// The endpoint to perform healthchecks on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Target { get; set; } +#nullable restore +#else + public string Target { get; set; } +#endif + /// The type of health check to perform. + public global::InfinityFlow.DigitalOcean.Client.Models.Check_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Check() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Check CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Check(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enabled", n => { Enabled = n.GetBoolValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "regions", n => { Regions = n.GetCollectionOfEnumValues()?.AsList(); } }, + { "target", n => { Target = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("enabled", Enabled); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfEnumValues("regions", Regions); + writer.WriteStringValue("target", Target); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Check_regions.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Check_regions.cs new file mode 100644 index 0000000..112ca65 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Check_regions.cs @@ -0,0 +1,28 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Check_regions + #pragma warning restore CS1591 + { + [EnumMember(Value = "us_east")] + #pragma warning disable CS1591 + Us_east, + #pragma warning restore CS1591 + [EnumMember(Value = "us_west")] + #pragma warning disable CS1591 + Us_west, + #pragma warning restore CS1591 + [EnumMember(Value = "eu_west")] + #pragma warning disable CS1591 + Eu_west, + #pragma warning restore CS1591 + [EnumMember(Value = "se_asia")] + #pragma warning disable CS1591 + Se_asia, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Check_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Check_type.cs new file mode 100644 index 0000000..6739bc1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Check_type.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of health check to perform. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Check_type + { + [EnumMember(Value = "ping")] + #pragma warning disable CS1591 + Ping, + #pragma warning restore CS1591 + [EnumMember(Value = "http")] + #pragma warning disable CS1591 + Http, + #pragma warning restore CS1591 + [EnumMember(Value = "https")] + #pragma warning disable CS1591 + Https, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable.cs new file mode 100644 index 0000000..ae22ca5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Check_updatable : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether the check is enabled/disabled. + public bool? Enabled { get; set; } + /// A human-friendly display name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An array containing the selected regions to perform healthchecks from. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// The endpoint to perform healthchecks on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Target { get; set; } +#nullable restore +#else + public string Target { get; set; } +#endif + /// The type of health check to perform. + public global::InfinityFlow.DigitalOcean.Client.Models.Check_updatable_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Check_updatable() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Check_updatable CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Check_updatable(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enabled", n => { Enabled = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "regions", n => { Regions = n.GetCollectionOfEnumValues()?.AsList(); } }, + { "target", n => { Target = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("enabled", Enabled); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfEnumValues("regions", Regions); + writer.WriteStringValue("target", Target); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable_regions.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable_regions.cs new file mode 100644 index 0000000..58f7d10 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable_regions.cs @@ -0,0 +1,28 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Check_updatable_regions + #pragma warning restore CS1591 + { + [EnumMember(Value = "us_east")] + #pragma warning disable CS1591 + Us_east, + #pragma warning restore CS1591 + [EnumMember(Value = "us_west")] + #pragma warning disable CS1591 + Us_west, + #pragma warning restore CS1591 + [EnumMember(Value = "eu_west")] + #pragma warning disable CS1591 + Eu_west, + #pragma warning restore CS1591 + [EnumMember(Value = "se_asia")] + #pragma warning disable CS1591 + Se_asia, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable_type.cs new file mode 100644 index 0000000..6b48b65 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Check_updatable_type.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of health check to perform. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Check_updatable_type + { + [EnumMember(Value = "ping")] + #pragma warning disable CS1591 + Ping, + #pragma warning restore CS1591 + [EnumMember(Value = "http")] + #pragma warning disable CS1591 + Http, + #pragma warning restore CS1591 + [EnumMember(Value = "https")] + #pragma warning disable CS1591 + Https, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Cluster.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster.cs new file mode 100644 index 0000000..de9cdb3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Cluster : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window. + public bool? AutoUpgrade { get; set; } + /// The range of IP addresses for the overlay network of the Kubernetes cluster in CIDR notation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterSubnet { get; set; } +#nullable restore +#else + public string ClusterSubnet { get; set; } +#endif + /// An object specifying the control plane firewall for the Kubernetes cluster. Control plane firewall is in early availability (invite only). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall? ControlPlaneFirewall { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall ControlPlaneFirewall { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// The base URL of the API server on the Kubernetes master node. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; private set; } +#nullable restore +#else + public string Endpoint { get; private set; } +#endif + /// A boolean value indicating whether the control plane is run in a highly available configuration in the cluster. Highly available control planes incur less downtime. The property cannot be disabled. + public bool? Ha { get; set; } + /// A unique ID that can be used to identify and reference a Kubernetes cluster. + public Guid? Id { get; private set; } + /// The public IPv4 address of the Kubernetes master node. This will not be set if high availability is configured on the cluster (v1.21+) +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ipv4 { get; private set; } +#nullable restore +#else + public string Ipv4 { get; private set; } +#endif + /// An object specifying the maintenance window policy for the Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy? MaintenancePolicy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy MaintenancePolicy { get; set; } +#endif + /// A human-readable name for a Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An object specifying the details of the worker nodes available to the Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NodePools { get; set; } +#nullable restore +#else + public List NodePools { get; set; } +#endif + /// The slug identifier for the region where the Kubernetes cluster is located. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// A read-only boolean value indicating if a container registry is integrated with the cluster. + public bool? RegistryEnabled { get; private set; } + /// The range of assignable IP addresses for services running in the Kubernetes cluster in CIDR notation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServiceSubnet { get; set; } +#nullable restore +#else + public string ServiceSubnet { get; set; } +#endif + /// An object containing a `state` attribute whose value is set to a string indicating the current status of the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster_status? Status { get; private set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster_status Status { get; private set; } +#endif + /// A boolean value indicating whether surge upgrade is enabled/disabled for the cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing up new nodes before destroying the outdated nodes. + public bool? SurgeUpgrade { get; set; } + /// An array of tags applied to the Kubernetes cluster. All clusters are automatically tagged `k8s` and `k8s:$K8S_CLUSTER_ID`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. + public DateTimeOffset? UpdatedAt { get; private set; } + /// The slug identifier for the version of Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the latest version within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest published version will be used. See the `/v2/kubernetes/options` endpoint to find all currently available versions. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. + public Guid? VpcUuid { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Cluster() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Cluster CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Cluster(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auto_upgrade", n => { AutoUpgrade = n.GetBoolValue(); } }, + { "cluster_subnet", n => { ClusterSubnet = n.GetStringValue(); } }, + { "control_plane_firewall", n => { ControlPlaneFirewall = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall.CreateFromDiscriminatorValue); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + { "ha", n => { Ha = n.GetBoolValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "ipv4", n => { Ipv4 = n.GetStringValue(); } }, + { "maintenance_policy", n => { MaintenancePolicy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "node_pools", n => { NodePools = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool.CreateFromDiscriminatorValue)?.AsList(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "registry_enabled", n => { RegistryEnabled = n.GetBoolValue(); } }, + { "service_subnet", n => { ServiceSubnet = n.GetStringValue(); } }, + { "status", n => { Status = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_status.CreateFromDiscriminatorValue); } }, + { "surge_upgrade", n => { SurgeUpgrade = n.GetBoolValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + { "version", n => { Version = n.GetStringValue(); } }, + { "vpc_uuid", n => { VpcUuid = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("auto_upgrade", AutoUpgrade); + writer.WriteStringValue("cluster_subnet", ClusterSubnet); + writer.WriteObjectValue("control_plane_firewall", ControlPlaneFirewall); + writer.WriteBoolValue("ha", Ha); + writer.WriteObjectValue("maintenance_policy", MaintenancePolicy); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfObjectValues("node_pools", NodePools); + writer.WriteStringValue("region", Region); + writer.WriteStringValue("service_subnet", ServiceSubnet); + writer.WriteBoolValue("surge_upgrade", SurgeUpgrade); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteStringValue("version", Version); + writer.WriteGuidValue("vpc_uuid", VpcUuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_registries.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_registries.cs new file mode 100644 index 0000000..3c959f5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_registries.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Cluster_registries : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array containing the UUIDs of Kubernetes clusters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ClusterUuids { get; set; } +#nullable restore +#else + public List ClusterUuids { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Cluster_registries() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cluster_uuids", n => { ClusterUuids = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("cluster_uuids", ClusterUuids); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_status.cs new file mode 100644 index 0000000..e0c695a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_status.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing a `state` attribute whose value is set to a string indicating the current status of the cluster. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Cluster_status : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An optional message providing additional information about the current cluster state. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// A string indicating the current status of the cluster. + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster_status_state? State { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Cluster_status() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Cluster_status CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Cluster_status(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "message", n => { Message = n.GetStringValue(); } }, + { "state", n => { State = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("message", Message); + writer.WriteEnumValue("state", State); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_status_state.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_status_state.cs new file mode 100644 index 0000000..7f87a0c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_status_state.cs @@ -0,0 +1,39 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string indicating the current status of the cluster. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Cluster_status_state + { + [EnumMember(Value = "running")] + #pragma warning disable CS1591 + Running, + #pragma warning restore CS1591 + [EnumMember(Value = "provisioning")] + #pragma warning disable CS1591 + Provisioning, + #pragma warning restore CS1591 + [EnumMember(Value = "degraded")] + #pragma warning disable CS1591 + Degraded, + #pragma warning restore CS1591 + [EnumMember(Value = "error")] + #pragma warning disable CS1591 + Error, + #pragma warning restore CS1591 + [EnumMember(Value = "deleted")] + #pragma warning disable CS1591 + Deleted, + #pragma warning restore CS1591 + [EnumMember(Value = "upgrading")] + #pragma warning disable CS1591 + Upgrading, + #pragma warning restore CS1591 + [EnumMember(Value = "deleting")] + #pragma warning disable CS1591 + Deleting, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_update.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_update.cs new file mode 100644 index 0000000..87148b4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Cluster_update.cs @@ -0,0 +1,107 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Cluster_update : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window. + public bool? AutoUpgrade { get; set; } + /// An object specifying the control plane firewall for the Kubernetes cluster. Control plane firewall is in early availability (invite only). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall? ControlPlaneFirewall { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall ControlPlaneFirewall { get; set; } +#endif + /// A boolean value indicating whether the control plane is run in a highly available configuration in the cluster. Highly available control planes incur less downtime. The property cannot be disabled. + public bool? Ha { get; set; } + /// An object specifying the maintenance window policy for the Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy? MaintenancePolicy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy MaintenancePolicy { get; set; } +#endif + /// A human-readable name for a Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A boolean value indicating whether surge upgrade is enabled/disabled for the cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing up new nodes before destroying the outdated nodes. + public bool? SurgeUpgrade { get; set; } + /// An array of tags applied to the Kubernetes cluster. All clusters are automatically tagged `k8s` and `k8s:$K8S_CLUSTER_ID`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Cluster_update() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auto_upgrade", n => { AutoUpgrade = n.GetBoolValue(); } }, + { "control_plane_firewall", n => { ControlPlaneFirewall = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall.CreateFromDiscriminatorValue); } }, + { "ha", n => { Ha = n.GetBoolValue(); } }, + { "maintenance_policy", n => { MaintenancePolicy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "surge_upgrade", n => { SurgeUpgrade = n.GetBoolValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("auto_upgrade", AutoUpgrade); + writer.WriteObjectValue("control_plane_firewall", ControlPlaneFirewall); + writer.WriteBoolValue("ha", Ha); + writer.WriteObjectValue("maintenance_policy", MaintenancePolicy); + writer.WriteStringValue("name", Name); + writer.WriteBoolValue("surge_upgrade", SurgeUpgrade); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_request.cs new file mode 100644 index 0000000..3495c97 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_request.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Clusterlint_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of checks that will be run when clusterlint executes checks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ExcludeChecks { get; set; } +#nullable restore +#else + public List ExcludeChecks { get; set; } +#endif + /// An array of check groups that will be omitted when clusterlint executes checks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ExcludeGroups { get; set; } +#nullable restore +#else + public List ExcludeGroups { get; set; } +#endif + /// An array of checks that will be run when clusterlint executes checks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? IncludeChecks { get; set; } +#nullable restore +#else + public List IncludeChecks { get; set; } +#endif + /// An array of check groups that will be run when clusterlint executes checks. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? IncludeGroups { get; set; } +#nullable restore +#else + public List IncludeGroups { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Clusterlint_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "exclude_checks", n => { ExcludeChecks = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "exclude_groups", n => { ExcludeGroups = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "include_checks", n => { IncludeChecks = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "include_groups", n => { IncludeGroups = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("exclude_checks", ExcludeChecks); + writer.WriteCollectionOfPrimitiveValues("exclude_groups", ExcludeGroups); + writer.WriteCollectionOfPrimitiveValues("include_checks", IncludeChecks); + writer.WriteCollectionOfPrimitiveValues("include_groups", IncludeGroups); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results.cs new file mode 100644 index 0000000..b53880f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results.cs @@ -0,0 +1,83 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Clusterlint_results : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the schedule clusterlint run request was completed. + public DateTimeOffset? CompletedAt { get; set; } + /// An array of diagnostics reporting potential problems for the given cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Diagnostics { get; set; } +#nullable restore +#else + public List Diagnostics { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the schedule clusterlint run request was made. + public DateTimeOffset? RequestedAt { get; set; } + /// Id of the clusterlint run that can be used later to fetch the diagnostics. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunId { get; set; } +#nullable restore +#else + public string RunId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Clusterlint_results() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "completed_at", n => { CompletedAt = n.GetDateTimeOffsetValue(); } }, + { "diagnostics", n => { Diagnostics = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics.CreateFromDiscriminatorValue)?.AsList(); } }, + { "requested_at", n => { RequestedAt = n.GetDateTimeOffsetValue(); } }, + { "run_id", n => { RunId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("completed_at", CompletedAt); + writer.WriteCollectionOfObjectValues("diagnostics", Diagnostics); + writer.WriteDateTimeOffsetValue("requested_at", RequestedAt); + writer.WriteStringValue("run_id", RunId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results_diagnostics.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results_diagnostics.cs new file mode 100644 index 0000000..3c718cd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results_diagnostics.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Clusterlint_results_diagnostics : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The clusterlint check that resulted in the diagnostic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CheckName { get; set; } +#nullable restore +#else + public string CheckName { get; set; } +#endif + /// Feedback about the object for users to fix. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// Metadata about the Kubernetes API object the diagnostic is reported on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics_object? Object { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics_object Object { get; set; } +#endif + /// Can be one of error, warning or suggestion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Severity { get; set; } +#nullable restore +#else + public string Severity { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Clusterlint_results_diagnostics() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "check_name", n => { CheckName = n.GetStringValue(); } }, + { "message", n => { Message = n.GetStringValue(); } }, + { "object", n => { Object = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics_object.CreateFromDiscriminatorValue); } }, + { "severity", n => { Severity = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("check_name", CheckName); + writer.WriteStringValue("message", Message); + writer.WriteObjectValue("object", Object); + writer.WriteStringValue("severity", Severity); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results_diagnostics_object.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results_diagnostics_object.cs new file mode 100644 index 0000000..8e8474b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Clusterlint_results_diagnostics_object.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Metadata about the Kubernetes API object the diagnostic is reported on. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Clusterlint_results_diagnostics_object : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kind of Kubernetes API object +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Kind { get; set; } +#nullable restore +#else + public string Kind { get; set; } +#endif + /// Name of the object +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The namespace the object resides in the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Namespace { get; set; } +#nullable restore +#else + public string Namespace { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Clusterlint_results_diagnostics_object() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics_object CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results_diagnostics_object(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kind", n => { Kind = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "namespace", n => { Namespace = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("kind", Kind); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("namespace", Namespace); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pool.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pool.cs new file mode 100644 index 0000000..c41cd70 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pool.cs @@ -0,0 +1,139 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Connection_pool : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? Connection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection Connection { get; set; } +#endif + /// The database for use with the connection pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Db { get; set; } +#nullable restore +#else + public string Db { get; set; } +#endif + /// The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Mode { get; set; } +#nullable restore +#else + public string Mode { get; set; } +#endif + /// A unique name for the connection pool. Must be between 3 and 60 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The private_connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? PrivateConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection PrivateConnection { get; set; } +#endif + /// The desired size of the PGBouncer connection pool. The maximum allowed size is determined by the size of the cluster's primary node. 25 backend server connections are allowed for every 1GB of RAM. Three are reserved for maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of 22 backend server connections while one with 4 GB would allow for 97. Note that these are shared across all connection pools in a cluster. + public int? Size { get; set; } + /// The standby_connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? StandbyConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection StandbyConnection { get; set; } +#endif + /// The standby_private_connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? StandbyPrivateConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection StandbyPrivateConnection { get; set; } +#endif + /// The name of the user for use with the connection pool. When excluded, all sessions connect to the database as the inbound user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Connection_pool() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "connection", n => { Connection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "db", n => { Db = n.GetStringValue(); } }, + { "mode", n => { Mode = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "private_connection", n => { PrivateConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "size", n => { Size = n.GetIntValue(); } }, + { "standby_connection", n => { StandbyConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "standby_private_connection", n => { StandbyPrivateConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("connection", Connection); + writer.WriteStringValue("db", Db); + writer.WriteStringValue("mode", Mode); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("private_connection", PrivateConnection); + writer.WriteIntValue("size", Size); + writer.WriteObjectValue("standby_connection", StandbyConnection); + writer.WriteObjectValue("standby_private_connection", StandbyPrivateConnection); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pool_update.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pool_update.cs new file mode 100644 index 0000000..532c83d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pool_update.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Connection_pool_update : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The database for use with the connection pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Db { get; set; } +#nullable restore +#else + public string Db { get; set; } +#endif + /// The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Mode { get; set; } +#nullable restore +#else + public string Mode { get; set; } +#endif + /// The desired size of the PGBouncer connection pool. The maximum allowed size is determined by the size of the cluster's primary node. 25 backend server connections are allowed for every 1GB of RAM. Three are reserved for maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of 22 backend server connections while one with 4 GB would allow for 97. Note that these are shared across all connection pools in a cluster. + public int? Size { get; set; } + /// The name of the user for use with the connection pool. When excluded, all sessions connect to the database as the inbound user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Connection_pool_update() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool_update CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool_update(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "db", n => { Db = n.GetStringValue(); } }, + { "mode", n => { Mode = n.GetStringValue(); } }, + { "size", n => { Size = n.GetIntValue(); } }, + { "user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("db", Db); + writer.WriteStringValue("mode", Mode); + writer.WriteIntValue("size", Size); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pools.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pools.cs new file mode 100644 index 0000000..e6500a0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Connection_pools.cs @@ -0,0 +1,64 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Connection_pools : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of connection pool objects. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Pools { get; private set; } +#nullable restore +#else + public List Pools { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Connection_pools() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Connection_pools CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Connection_pools(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "pools", n => { Pools = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Control_plane_firewall.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Control_plane_firewall.cs new file mode 100644 index 0000000..8f95c57 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Control_plane_firewall.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object specifying the control plane firewall for the Kubernetes cluster. Control plane firewall is in early availability (invite only). + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Control_plane_firewall : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of public addresses (IPv4 or CIDR) allowed to access the control plane. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AllowedAddresses { get; set; } +#nullable restore +#else + public List AllowedAddresses { get; set; } +#endif + /// Indicates whether the control plane firewall is enabled. + public bool? Enable { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Control_plane_firewall() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Control_plane_firewall(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allowed_addresses", n => { AllowedAddresses = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "enable", n => { Enable = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("allowed_addresses", AllowedAddresses); + writer.WriteBoolValue("enable", Enable); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Create_namespace.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Create_namespace.cs new file mode 100644 index 0000000..b68a5c0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Create_namespace.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Create_namespace : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The namespace's unique name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Label { get; set; } +#nullable restore +#else + public string Label { get; set; } +#endif + /// The [datacenter region](https://docs.digitalocean.com/products/platform/availability-matrix/#available-datacenters) in which to create the namespace. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Create_namespace() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "label", n => { Label = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("label", Label); + writer.WriteStringValue("region", Region); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Create_trigger.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Create_trigger.cs new file mode 100644 index 0000000..7453ea9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Create_trigger.cs @@ -0,0 +1,99 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Create_trigger : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Name of function(action) that exists in the given namespace. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Function { get; set; } +#nullable restore +#else + public string Function { get; set; } +#endif + /// Indicates weather the trigger is paused or unpaused. + public bool? IsEnabled { get; set; } + /// The trigger's unique name within the namespace. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Trigger details for SCHEDULED type, where body is optional. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details? ScheduledDetails { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details ScheduledDetails { get; set; } +#endif + /// One of different type of triggers. Currently only SCHEDULED is supported. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Create_trigger() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "function", n => { Function = n.GetStringValue(); } }, + { "is_enabled", n => { IsEnabled = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "scheduled_details", n => { ScheduledDetails = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("function", Function); + writer.WriteBoolValue("is_enabled", IsEnabled); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("scheduled_details", ScheduledDetails); + writer.WriteStringValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Credentials.cs new file mode 100644 index 0000000..77172e4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Credentials.cs @@ -0,0 +1,111 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Credentials : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A base64 encoding of bytes representing the certificate authority data for accessing the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CertificateAuthorityData { get; set; } +#nullable restore +#else + public string CertificateAuthorityData { get; set; } +#endif + /// A base64 encoding of bytes representing the x509 clientcertificate data for access the cluster. This is only returned for clusterswithout support for token-based authentication.Newly created Kubernetes clusters do not return credentials usingcertificate-based authentication. For additional information,[see here](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/#authenticate). + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClientCertificateData { get; set; } +#nullable restore +#else + public string ClientCertificateData { get; set; } +#endif + /// A base64 encoding of bytes representing the x509 client keydata for access the cluster. This is only returned for clusters withoutsupport for token-based authentication.Newly created Kubernetes clusters do not return credentials usingcertificate-based authentication. For additional information,[see here](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/#authenticate). + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClientKeyData { get; set; } +#nullable restore +#else + public string ClientKeyData { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the access token expires. + public DateTimeOffset? ExpiresAt { get; set; } + /// The URL used to access the cluster API server. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Server { get; set; } +#nullable restore +#else + public string Server { get; set; } +#endif + /// An access token used to authenticate with the cluster. This is only returned for clusters with support for token-based authentication. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Token { get; set; } +#nullable restore +#else + public string Token { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate_authority_data", n => { CertificateAuthorityData = n.GetStringValue(); } }, + { "client_certificate_data", n => { ClientCertificateData = n.GetStringValue(); } }, + { "client_key_data", n => { ClientKeyData = n.GetStringValue(); } }, + { "expires_at", n => { ExpiresAt = n.GetDateTimeOffsetValue(); } }, + { "server", n => { Server = n.GetStringValue(); } }, + { "token", n => { Token = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("certificate_authority_data", CertificateAuthorityData); + writer.WriteStringValue("client_certificate_data", ClientCertificateData); + writer.WriteStringValue("client_key_data", ClientKeyData); + writer.WriteDateTimeOffsetValue("expires_at", ExpiresAt); + writer.WriteStringValue("server", Server); + writer.WriteStringValue("token", Token); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database.cs new file mode 100644 index 0000000..4950c6e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the database. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_backup.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_backup.cs new file mode 100644 index 0000000..15816ab --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_backup.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_backup : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The timestamp of an existing database cluster backup in ISO8601 combined date and time format. The most recent backup will be used if excluded. + public DateTimeOffset? BackupCreatedAt { get; set; } + /// The name of an existing database cluster from which the backup will be restored. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DatabaseName { get; set; } +#nullable restore +#else + public string DatabaseName { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_backup() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_backup CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_backup(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "backup_created_at", n => { BackupCreatedAt = n.GetDateTimeOffsetValue(); } }, + { "database_name", n => { DatabaseName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("backup_created_at", BackupCreatedAt); + writer.WriteStringValue("database_name", DatabaseName); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster.cs new file mode 100644 index 0000000..df04bb1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster.cs @@ -0,0 +1,264 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_cluster : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? Connection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection Connection { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the database cluster was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// An array of strings containing the names of databases created in the database cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DbNames { get; private set; } +#nullable restore +#else + public List DbNames { get; private set; } +#endif + /// A slug representing the database engine used for the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka, and "opensearch" for OpenSearch. + public global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_engine? Engine { get; set; } + /// A unique ID that can be used to identify and reference a database cluster. + public Guid? Id { get; private set; } + /// The maintenance_window property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window? MaintenanceWindow { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window MaintenanceWindow { get; set; } +#endif + /// Public hostname and port of the cluster's metrics endpoint(s). Includes one record for the cluster's primary node and a second entry for the cluster's standby node(s). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetricsEndpoints { get; private set; } +#nullable restore +#else + public List MetricsEndpoints { get; private set; } +#endif + /// A unique, human-readable name referring to a database cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The number of nodes in the database cluster. + public int? NumNodes { get; set; } + /// The private_connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? PrivateConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection PrivateConnection { get; set; } +#endif + /// A string specifying the UUID of the VPC to which the database cluster will be assigned. If excluded, the cluster when creating a new database cluster, it will be assigned to your account's default VPC for the region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PrivateNetworkUuid { get; set; } +#nullable restore +#else + public string PrivateNetworkUuid { get; set; } +#endif + /// The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. + public Guid? ProjectId { get; set; } + /// The slug identifier for the region where the database cluster is located. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// The rules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Rules { get; set; } +#nullable restore +#else + public List Rules { get; set; } +#endif + /// A string representing the semantic version of the database engine in use for the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SemanticVersion { get; private set; } +#nullable restore +#else + public string SemanticVersion { get; private set; } +#endif + /// The slug identifier representing the size of the nodes in the database cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Size { get; set; } +#nullable restore +#else + public string Size { get; set; } +#endif + /// The standby_connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? StandbyConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection StandbyConnection { get; set; } +#endif + /// The standby_private_connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? StandbyPrivateConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection StandbyPrivateConnection { get; set; } +#endif + /// A string representing the current status of the database cluster. + public global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_status? Status { get; private set; } + /// Additional storage added to the cluster, in MiB. If null, no additional storage is added to the cluster, beyond what is provided as a base amount from the 'size' and any previously added additional storage. + public int? StorageSizeMib { get; set; } + /// An array of tags that have been applied to the database cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// The connection details for OpenSearch dashboard. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_connection? UiConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_connection UiConnection { get; set; } +#endif + /// The users property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Users { get; private set; } +#nullable restore +#else + public List Users { get; private set; } +#endif + /// A string representing the version of the database engine in use for the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// A timestamp referring to the date when the particular version will no longer be available for creating new clusters. If null, the version does not have an end of availability timeline. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VersionEndOfAvailability { get; private set; } +#nullable restore +#else + public string VersionEndOfAvailability { get; private set; } +#endif + /// A timestamp referring to the date when the particular version will no longer be supported. If null, the version does not have an end of life timeline. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VersionEndOfLife { get; private set; } +#nullable restore +#else + public string VersionEndOfLife { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_cluster() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "connection", n => { Connection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "db_names", n => { DbNames = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "engine", n => { Engine = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "maintenance_window", n => { MaintenanceWindow = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window.CreateFromDiscriminatorValue); } }, + { "metrics_endpoints", n => { MetricsEndpoints = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_service_endpoint.CreateFromDiscriminatorValue)?.AsList(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "num_nodes", n => { NumNodes = n.GetIntValue(); } }, + { "private_connection", n => { PrivateConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "private_network_uuid", n => { PrivateNetworkUuid = n.GetStringValue(); } }, + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "rules", n => { Rules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule.CreateFromDiscriminatorValue)?.AsList(); } }, + { "semantic_version", n => { SemanticVersion = n.GetStringValue(); } }, + { "size", n => { Size = n.GetStringValue(); } }, + { "standby_connection", n => { StandbyConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "standby_private_connection", n => { StandbyPrivateConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "storage_size_mib", n => { StorageSizeMib = n.GetIntValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "ui_connection", n => { UiConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_connection.CreateFromDiscriminatorValue); } }, + { "users", n => { Users = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_user.CreateFromDiscriminatorValue)?.AsList(); } }, + { "version", n => { Version = n.GetStringValue(); } }, + { "version_end_of_availability", n => { VersionEndOfAvailability = n.GetStringValue(); } }, + { "version_end_of_life", n => { VersionEndOfLife = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("connection", Connection); + writer.WriteEnumValue("engine", Engine); + writer.WriteObjectValue("maintenance_window", MaintenanceWindow); + writer.WriteStringValue("name", Name); + writer.WriteIntValue("num_nodes", NumNodes); + writer.WriteObjectValue("private_connection", PrivateConnection); + writer.WriteStringValue("private_network_uuid", PrivateNetworkUuid); + writer.WriteGuidValue("project_id", ProjectId); + writer.WriteStringValue("region", Region); + writer.WriteCollectionOfObjectValues("rules", Rules); + writer.WriteStringValue("size", Size); + writer.WriteObjectValue("standby_connection", StandbyConnection); + writer.WriteObjectValue("standby_private_connection", StandbyPrivateConnection); + writer.WriteIntValue("storage_size_mib", StorageSizeMib); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteObjectValue("ui_connection", UiConnection); + writer.WriteStringValue("version", Version); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_engine.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_engine.cs new file mode 100644 index 0000000..9cd6885 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_engine.cs @@ -0,0 +1,35 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A slug representing the database engine used for the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka, and "opensearch" for OpenSearch. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Database_cluster_engine + { + [EnumMember(Value = "pg")] + #pragma warning disable CS1591 + Pg, + #pragma warning restore CS1591 + [EnumMember(Value = "mysql")] + #pragma warning disable CS1591 + Mysql, + #pragma warning restore CS1591 + [EnumMember(Value = "redis")] + #pragma warning disable CS1591 + Redis, + #pragma warning restore CS1591 + [EnumMember(Value = "mongodb")] + #pragma warning disable CS1591 + Mongodb, + #pragma warning restore CS1591 + [EnumMember(Value = "kafka")] + #pragma warning disable CS1591 + Kafka, + #pragma warning restore CS1591 + [EnumMember(Value = "opensearch")] + #pragma warning disable CS1591 + Opensearch, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_resize.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_resize.cs new file mode 100644 index 0000000..646f934 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_resize.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_cluster_resize : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of nodes in the database cluster. Valid values are are 1-3. In addition to the primary node, up to two standby nodes may be added for highly available configurations. + public int? NumNodes { get; set; } + /// A slug identifier representing desired the size of the nodes in the database cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Size { get; set; } +#nullable restore +#else + public string Size { get; set; } +#endif + /// Additional storage added to the cluster, in MiB. If null, no additional storage is added to the cluster, beyond what is provided as a base amount from the 'size' and any previously added additional storage. + public int? StorageSizeMib { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Database_cluster_resize() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_resize CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_resize(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "num_nodes", n => { NumNodes = n.GetIntValue(); } }, + { "size", n => { Size = n.GetStringValue(); } }, + { "storage_size_mib", n => { StorageSizeMib = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("num_nodes", NumNodes); + writer.WriteStringValue("size", Size); + writer.WriteIntValue("storage_size_mib", StorageSizeMib); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_status.cs new file mode 100644 index 0000000..ba58d2a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_cluster_status.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string representing the current status of the database cluster. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Database_cluster_status + { + [EnumMember(Value = "creating")] + #pragma warning disable CS1591 + Creating, + #pragma warning restore CS1591 + [EnumMember(Value = "online")] + #pragma warning disable CS1591 + Online, + #pragma warning restore CS1591 + [EnumMember(Value = "resizing")] + #pragma warning disable CS1591 + Resizing, + #pragma warning restore CS1591 + [EnumMember(Value = "migrating")] + #pragma warning disable CS1591 + Migrating, + #pragma warning restore CS1591 + [EnumMember(Value = "forking")] + #pragma warning disable CS1591 + Forking, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_config.cs new file mode 100644 index 0000000..dc88e50 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_config.cs @@ -0,0 +1,158 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_config.Database_config_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_config.Database_config_config Config { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_config() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_config.Database_config_config.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes , , , , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Database_config_config : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config? KafkaAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config KafkaAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config? MongoAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config MongoAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config? MysqlAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config MysqlAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config? OpensearchAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config OpensearchAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config? PostgresAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config PostgresAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config? RedisAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config RedisAdvancedConfig { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_config.Database_config_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Database_config.Database_config_config(); + result.KafkaAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config(); + result.MongoAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config(); + result.MysqlAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config(); + result.OpensearchAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config(); + result.PostgresAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config(); + result.RedisAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(KafkaAdvancedConfig != null || MongoAdvancedConfig != null || MysqlAdvancedConfig != null || OpensearchAdvancedConfig != null || PostgresAdvancedConfig != null || RedisAdvancedConfig != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(KafkaAdvancedConfig, MongoAdvancedConfig, MysqlAdvancedConfig, OpensearchAdvancedConfig, PostgresAdvancedConfig, RedisAdvancedConfig); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, KafkaAdvancedConfig, MongoAdvancedConfig, MysqlAdvancedConfig, OpensearchAdvancedConfig, PostgresAdvancedConfig, RedisAdvancedConfig); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_connection.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_connection.cs new file mode 100644 index 0000000..94b8463 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_connection.cs @@ -0,0 +1,106 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_connection : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the default database. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Database { get; private set; } +#nullable restore +#else + public string Database { get; private set; } +#endif + /// The FQDN pointing to the database cluster's current primary node. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Host { get; private set; } +#nullable restore +#else + public string Host { get; private set; } +#endif + /// The randomly generated password for the default user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; private set; } +#nullable restore +#else + public string Password { get; private set; } +#endif + /// The port on which the database cluster is listening. + public int? Port { get; private set; } + /// A boolean value indicating if the connection should be made over SSL. + public bool? Ssl { get; private set; } + /// A connection string in the format accepted by the `psql` command. This is provided as a convenience and should be able to be constructed by the other attributes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uri { get; private set; } +#nullable restore +#else + public string Uri { get; private set; } +#endif + /// The default user for the database. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; private set; } +#nullable restore +#else + public string User { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_connection() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_connection CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_connection(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "database", n => { Database = n.GetStringValue(); } }, + { "host", n => { Host = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "port", n => { Port = n.GetIntValue(); } }, + { "ssl", n => { Ssl = n.GetBoolValue(); } }, + { "uri", n => { Uri = n.GetStringValue(); } }, + { "user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_layout_option.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_layout_option.cs new file mode 100644 index 0000000..4f664fe --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_layout_option.cs @@ -0,0 +1,68 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_layout_option : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The num_nodes property + public int? NumNodes { get; set; } + /// An array of objects containing the slugs available with various node counts +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Sizes { get; private set; } +#nullable restore +#else + public List Sizes { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_layout_option() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "num_nodes", n => { NumNodes = n.GetIntValue(); } }, + { "sizes", n => { Sizes = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("num_nodes", NumNodes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_maintenance_window.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_maintenance_window.cs new file mode 100644 index 0000000..f50d145 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_maintenance_window.cs @@ -0,0 +1,87 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_maintenance_window : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The day of the week on which to apply maintenance updates. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Day { get; set; } +#nullable restore +#else + public string Day { get; set; } +#endif + /// A list of strings, each containing information about a pending maintenance update. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Description { get; private set; } +#nullable restore +#else + public List Description { get; private set; } +#endif + /// The hour in UTC at which maintenance updates will be applied in 24 hour format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Hour { get; set; } +#nullable restore +#else + public string Hour { get; set; } +#endif + /// A boolean value indicating whether any maintenance is scheduled to be performed in the next window. + public bool? Pending { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public Database_maintenance_window() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "day", n => { Day = n.GetStringValue(); } }, + { "description", n => { Description = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "hour", n => { Hour = n.GetStringValue(); } }, + { "pending", n => { Pending = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("day", Day); + writer.WriteStringValue("hour", Hour); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_metrics_credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_metrics_credentials.cs new file mode 100644 index 0000000..d7c1621 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_metrics_credentials.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_metrics_credentials : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The credentials property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Databases_basic_auth_credentials? Credentials { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Databases_basic_auth_credentials Credentials { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_metrics_credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "credentials", n => { Credentials = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Databases_basic_auth_credentials.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("credentials", Credentials); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_replica.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_replica.cs new file mode 100644 index 0000000..0913a51 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_replica.cs @@ -0,0 +1,138 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_replica : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? Connection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection Connection { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the database cluster was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// A unique ID that can be used to identify and reference a database replica. + public Guid? Id { get; private set; } + /// The name to give the read-only replicating +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The private_connection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection? PrivateConnection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_connection PrivateConnection { get; set; } +#endif + /// A string specifying the UUID of the VPC to which the read-only replica will be assigned. If excluded, the replica will be assigned to your account's default VPC for the region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PrivateNetworkUuid { get; set; } +#nullable restore +#else + public string PrivateNetworkUuid { get; set; } +#endif + /// A slug identifier for the region where the read-only replica will be located. If excluded, the replica will be placed in the same region as the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// A slug identifier representing the size of the node for the read-only replica. The size of the replica must be at least as large as the node size for the database cluster from which it is replicating. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Size { get; set; } +#nullable restore +#else + public string Size { get; set; } +#endif + /// A string representing the current status of the database cluster. + public global::InfinityFlow.DigitalOcean.Client.Models.Database_replica_status? Status { get; private set; } + /// Additional storage added to the cluster, in MiB. If null, no additional storage is added to the cluster, beyond what is provided as a base amount from the 'size' and any previously added additional storage. + public int? StorageSizeMib { get; set; } + /// A flat array of tag names as strings to apply to the read-only replica after it is created. Tag names can either be existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_replica() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_replica CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_replica(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "connection", n => { Connection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "private_connection", n => { PrivateConnection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_connection.CreateFromDiscriminatorValue); } }, + { "private_network_uuid", n => { PrivateNetworkUuid = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "size", n => { Size = n.GetStringValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "storage_size_mib", n => { StorageSizeMib = n.GetIntValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("connection", Connection); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("private_connection", PrivateConnection); + writer.WriteStringValue("private_network_uuid", PrivateNetworkUuid); + writer.WriteStringValue("region", Region); + writer.WriteStringValue("size", Size); + writer.WriteIntValue("storage_size_mib", StorageSizeMib); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_replica_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_replica_status.cs new file mode 100644 index 0000000..a1e498e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_replica_status.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string representing the current status of the database cluster. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Database_replica_status + { + [EnumMember(Value = "creating")] + #pragma warning disable CS1591 + Creating, + #pragma warning restore CS1591 + [EnumMember(Value = "online")] + #pragma warning disable CS1591 + Online, + #pragma warning restore CS1591 + [EnumMember(Value = "resizing")] + #pragma warning disable CS1591 + Resizing, + #pragma warning restore CS1591 + [EnumMember(Value = "migrating")] + #pragma warning disable CS1591 + Migrating, + #pragma warning restore CS1591 + [EnumMember(Value = "forking")] + #pragma warning disable CS1591 + Forking, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_service_endpoint.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_service_endpoint.cs new file mode 100644 index 0000000..dbd6d12 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_service_endpoint.cs @@ -0,0 +1,67 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_service_endpoint : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A FQDN pointing to the database cluster's node(s). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Host { get; private set; } +#nullable restore +#else + public string Host { get; private set; } +#endif + /// The port on which a service is listening. + public int? Port { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public Database_service_endpoint() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_service_endpoint CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_service_endpoint(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "host", n => { Host = n.GetStringValue(); } }, + { "port", n => { Port = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_user.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_user.cs new file mode 100644 index 0000000..d7b8158 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_user.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_user : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Access certificate for TLS client authentication. (Kafka only) +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AccessCert { get; private set; } +#nullable restore +#else + public string AccessCert { get; private set; } +#endif + /// Access key for TLS client authentication. (Kafka only) +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AccessKey { get; private set; } +#nullable restore +#else + public string AccessKey { get; private set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The mysql_settings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings? MysqlSettings { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings MysqlSettings { get; set; } +#endif + /// The name of a database user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A randomly generated password for the database user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; private set; } +#nullable restore +#else + public string Password { get; private set; } +#endif + /// A string representing the database user's role. The value will be either"primary" or "normal". + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user_role? Role { get; private set; } + /// The settings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.User_settings? Settings { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.User_settings Settings { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_user() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_user CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_user(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "access_cert", n => { AccessCert = n.GetStringValue(); } }, + { "access_key", n => { AccessKey = n.GetStringValue(); } }, + { "mysql_settings", n => { MysqlSettings = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "role", n => { Role = n.GetEnumValue(); } }, + { "settings", n => { Settings = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.User_settings.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mysql_settings", MysqlSettings); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("settings", Settings); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_user_role.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_user_role.cs new file mode 100644 index 0000000..0550102 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_user_role.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string representing the database user's role. The value will be either"primary" or "normal". + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Database_user_role + { + [EnumMember(Value = "primary")] + #pragma warning disable CS1591 + Primary, + #pragma warning restore CS1591 + [EnumMember(Value = "normal")] + #pragma warning disable CS1591 + Normal, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Database_version_availability.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Database_version_availability.cs new file mode 100644 index 0000000..5934622 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Database_version_availability.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Database_version_availability : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A timestamp referring to the date when the particular version will no longer be available for creating new clusters. If null, the version does not have an end of availability timeline. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EndOfAvailability { get; set; } +#nullable restore +#else + public string EndOfAvailability { get; set; } +#endif + /// A timestamp referring to the date when the particular version will no longer be supported. If null, the version does not have an end of life timeline. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EndOfLife { get; set; } +#nullable restore +#else + public string EndOfLife { get; set; } +#endif + /// The engine version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Database_version_availability() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "end_of_availability", n => { EndOfAvailability = n.GetStringValue(); } }, + { "end_of_life", n => { EndOfLife = n.GetStringValue(); } }, + { "version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("end_of_availability", EndOfAvailability); + writer.WriteStringValue("end_of_life", EndOfLife); + writer.WriteStringValue("version", Version); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Databases_basic_auth_credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Databases_basic_auth_credentials.cs new file mode 100644 index 0000000..c1b1b4c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Databases_basic_auth_credentials.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Databases_basic_auth_credentials : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// basic authentication password for metrics HTTP endpoint +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BasicAuthPassword { get; set; } +#nullable restore +#else + public string BasicAuthPassword { get; set; } +#endif + /// basic authentication username for metrics HTTP endpoint +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BasicAuthUsername { get; set; } +#nullable restore +#else + public string BasicAuthUsername { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Databases_basic_auth_credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Databases_basic_auth_credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Databases_basic_auth_credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basic_auth_password", n => { BasicAuthPassword = n.GetStringValue(); } }, + { "basic_auth_username", n => { BasicAuthUsername = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("basic_auth_password", BasicAuthPassword); + writer.WriteStringValue("basic_auth_username", BasicAuthUsername); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destination.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destination.cs new file mode 100644 index 0000000..6b82b45 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destination.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Destination : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config Config { get; set; } +#endif + /// A unique identifier for a destination. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// destination name +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearchcluster or `opensearch_ext` for an externally managed one. + public global::InfinityFlow.DigitalOcean.Client.Models.Destination_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Destination() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Destination CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Destination(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destination_omit_credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_omit_credentials.cs new file mode 100644 index 0000000..f43d782 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_omit_credentials.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Destination_omit_credentials : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// OpenSearch destination configuration with `credentials` omitted. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_omit_credentials? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_omit_credentials Config { get; set; } +#endif + /// A unique identifier for a destination. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// destination name +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearchcluster or `opensearch_ext` for an externally managed one. + public global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Destination_omit_credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_omit_credentials.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destination_omit_credentials_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_omit_credentials_type.cs new file mode 100644 index 0000000..ba528d0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_omit_credentials_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearchcluster or `opensearch_ext` for an externally managed one. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Destination_omit_credentials_type + { + [EnumMember(Value = "opensearch_dbaas")] + #pragma warning disable CS1591 + Opensearch_dbaas, + #pragma warning restore CS1591 + [EnumMember(Value = "opensearch_ext")] + #pragma warning disable CS1591 + Opensearch_ext, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destination_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_request.cs new file mode 100644 index 0000000..3839303 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_request.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Destination_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request Config { get; set; } +#endif + /// destination name +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearchcluster or `opensearch_ext` for an externally managed one. + public global::InfinityFlow.DigitalOcean.Client.Models.Destination_request_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Destination_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Destination_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Destination_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destination_request_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_request_type.cs new file mode 100644 index 0000000..b36f0fd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_request_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearchcluster or `opensearch_ext` for an externally managed one. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Destination_request_type + { + [EnumMember(Value = "opensearch_dbaas")] + #pragma warning disable CS1591 + Opensearch_dbaas, + #pragma warning restore CS1591 + [EnumMember(Value = "opensearch_ext")] + #pragma warning disable CS1591 + Opensearch_ext, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destination_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_type.cs new file mode 100644 index 0000000..96ecf0c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destination_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearchcluster or `opensearch_ext` for an externally managed one. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Destination_type + { + [EnumMember(Value = "opensearch_dbaas")] + #pragma warning disable CS1591 + Opensearch_dbaas, + #pragma warning restore CS1591 + [EnumMember(Value = "opensearch_ext")] + #pragma warning disable CS1591 + Opensearch_ext, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destroy_associated_kubernetes_resources.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destroy_associated_kubernetes_resources.cs new file mode 100644 index 0000000..8a15c1f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destroy_associated_kubernetes_resources.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing the IDs of resources to be destroyed along with their associated with a Kubernetes cluster. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Destroy_associated_kubernetes_resources : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of IDs for associated load balancers to destroy along with the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LoadBalancers { get; set; } +#nullable restore +#else + public List LoadBalancers { get; set; } +#endif + /// A list of IDs for associated volumes to destroy along with the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Volumes { get; set; } +#nullable restore +#else + public List Volumes { get; set; } +#endif + /// A list of IDs for associated volume snapshots to destroy along with the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VolumeSnapshots { get; set; } +#nullable restore +#else + public List VolumeSnapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Destroy_associated_kubernetes_resources() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Destroy_associated_kubernetes_resources CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Destroy_associated_kubernetes_resources(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "load_balancers", n => { LoadBalancers = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "volume_snapshots", n => { VolumeSnapshots = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "volumes", n => { Volumes = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("load_balancers", LoadBalancers); + writer.WriteCollectionOfPrimitiveValues("volume_snapshots", VolumeSnapshots); + writer.WriteCollectionOfPrimitiveValues("volumes", Volumes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Destroyed_associated_resource.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Destroyed_associated_resource.cs new file mode 100644 index 0000000..6e36d37 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Destroyed_associated_resource.cs @@ -0,0 +1,90 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing information about a resource scheduled for deletion. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Destroyed_associated_resource : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful. + public DateTimeOffset? DestroyedAt { get; set; } + /// A string indicating that the resource was not successfully destroyed and providing additional information. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ErrorMessage { get; set; } +#nullable restore +#else + public string ErrorMessage { get; set; } +#endif + /// The unique identifier for the resource scheduled for deletion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The name of the resource scheduled for deletion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Destroyed_associated_resource() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Destroyed_associated_resource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "destroyed_at", n => { DestroyedAt = n.GetDateTimeOffsetValue(); } }, + { "error_message", n => { ErrorMessage = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("destroyed_at", DestroyedAt); + writer.WriteStringValue("error_message", ErrorMessage); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info.cs new file mode 100644 index 0000000..a503b14 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Disk_info : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The size property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Disk_info_size? Size { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Disk_info_size Size { get; set; } +#endif + /// The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data. + public global::InfinityFlow.DigitalOcean.Client.Models.Disk_info_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Disk_info() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Disk_info CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Disk_info(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "size", n => { Size = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Disk_info_size.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("size", Size); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info_size.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info_size.cs new file mode 100644 index 0000000..0052cfd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info_size.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Disk_info_size : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The amount of space allocated to the disk. + public int? Amount { get; set; } + /// The unit of measure for the disk size. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Unit { get; set; } +#nullable restore +#else + public string Unit { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Disk_info_size() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Disk_info_size CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Disk_info_size(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetIntValue(); } }, + { "unit", n => { Unit = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("amount", Amount); + writer.WriteStringValue("unit", Unit); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info_type.cs new file mode 100644 index 0000000..5c5c517 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Disk_info_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Disk_info_type + { + [EnumMember(Value = "local")] + #pragma warning disable CS1591 + Local, + #pragma warning restore CS1591 + [EnumMember(Value = "scratch")] + #pragma warning disable CS1591 + Scratch, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Distribution.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Distribution.cs new file mode 100644 index 0000000..7fba4d9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Distribution.cs @@ -0,0 +1,63 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Distribution + { + [EnumMember(Value = "Arch Linux")] + #pragma warning disable CS1591 + ArchLinux, + #pragma warning restore CS1591 + [EnumMember(Value = "CentOS")] + #pragma warning disable CS1591 + CentOS, + #pragma warning restore CS1591 + [EnumMember(Value = "CoreOS")] + #pragma warning disable CS1591 + CoreOS, + #pragma warning restore CS1591 + [EnumMember(Value = "Debian")] + #pragma warning disable CS1591 + Debian, + #pragma warning restore CS1591 + [EnumMember(Value = "Fedora")] + #pragma warning disable CS1591 + Fedora, + #pragma warning restore CS1591 + [EnumMember(Value = "Fedora Atomic")] + #pragma warning disable CS1591 + FedoraAtomic, + #pragma warning restore CS1591 + [EnumMember(Value = "FreeBSD")] + #pragma warning disable CS1591 + FreeBSD, + #pragma warning restore CS1591 + [EnumMember(Value = "Gentoo")] + #pragma warning disable CS1591 + Gentoo, + #pragma warning restore CS1591 + [EnumMember(Value = "openSUSE")] + #pragma warning disable CS1591 + OpenSUSE, + #pragma warning restore CS1591 + [EnumMember(Value = "RancherOS")] + #pragma warning disable CS1591 + RancherOS, + #pragma warning restore CS1591 + [EnumMember(Value = "Rocky Linux")] + #pragma warning disable CS1591 + RockyLinux, + #pragma warning restore CS1591 + [EnumMember(Value = "Ubuntu")] + #pragma warning disable CS1591 + Ubuntu, + #pragma warning restore CS1591 + [EnumMember(Value = "Unknown")] + #pragma warning disable CS1591 + Unknown, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials.cs new file mode 100644 index 0000000..bedcc1c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Docker_credentials : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The auths property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths? Auths { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths Auths { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Docker_credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auths", n => { Auths = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("auths", Auths); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials_auths.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials_auths.cs new file mode 100644 index 0000000..a9623ec --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials_auths.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Docker_credentials_auths : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The registryDigitaloceanCom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths_registryDigitaloceanCom? RegistryDigitaloceanCom { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths_registryDigitaloceanCom RegistryDigitaloceanCom { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Docker_credentials_auths() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "registry.digitalocean.com", n => { RegistryDigitaloceanCom = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths_registryDigitaloceanCom.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("registry.digitalocean.com", RegistryDigitaloceanCom); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials_auths_registryDigitaloceanCom.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials_auths_registryDigitaloceanCom.cs new file mode 100644 index 0000000..5ab1ed2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Docker_credentials_auths_registryDigitaloceanCom.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Docker_credentials_auths_registryDigitaloceanCom : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A base64 encoded string containing credentials for the container registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Auth { get; set; } +#nullable restore +#else + public string Auth { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Docker_credentials_auths_registryDigitaloceanCom() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths_registryDigitaloceanCom CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials_auths_registryDigitaloceanCom(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auth", n => { Auth = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("auth", Auth); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain.cs new file mode 100644 index 0000000..155ad55 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain.cs @@ -0,0 +1,87 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// This optional attribute may contain an IP address. When provided, an A record will be automatically created pointing to the apex domain. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IpAddress { get; set; } +#nullable restore +#else + public string IpAddress { get; set; } +#endif + /// The name of the domain itself. This should follow the standard domain format of domain.TLD. For instance, `example.com` is a valid domain name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// This value is the time to live for the records on this domain, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. + public int? Ttl { get; private set; } + /// This attribute contains the complete contents of the zone file for the selected domain. Individual domain record resources should be used to get more granular control over records. However, this attribute can also be used to get information about the SOA record, which is created automatically and is not accessible as an individual record resource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ZoneFile { get; private set; } +#nullable restore +#else + public string ZoneFile { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Domain() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Domain CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ip_address", n => { IpAddress = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "ttl", n => { Ttl = n.GetIntValue(); } }, + { "zone_file", n => { ZoneFile = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("ip_address", IpAddress); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record.cs new file mode 100644 index 0000000..a479459 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record.cs @@ -0,0 +1,118 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Data { get; set; } +#nullable restore +#else + public string Data { get; set; } +#endif + /// An unsigned integer between 0-255 used for CAA records. + public int? Flags { get; set; } + /// A unique identifier for each domain record. + public int? Id { get; private set; } + /// The host name, alias, or service being defined by the record. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The port for SRV records. + public int? Port { get; set; } + /// The priority for SRV and MX records. + public int? Priority { get; set; } + /// The parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef" +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Tag { get; set; } +#nullable restore +#else + public string Tag { get; set; } +#endif + /// This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. + public int? Ttl { get; set; } + /// The type of the DNS record. For example: A, CNAME, TXT, ... +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// The weight for SRV records. + public int? Weight { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Domain_record() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Domain_record CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetStringValue(); } }, + { "flags", n => { Flags = n.GetIntValue(); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "port", n => { Port = n.GetIntValue(); } }, + { "priority", n => { Priority = n.GetIntValue(); } }, + { "tag", n => { Tag = n.GetStringValue(); } }, + { "ttl", n => { Ttl = n.GetIntValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, + { "weight", n => { Weight = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("data", Data); + writer.WriteIntValue("flags", Flags); + writer.WriteStringValue("name", Name); + writer.WriteIntValue("port", Port); + writer.WriteIntValue("priority", Priority); + writer.WriteStringValue("tag", Tag); + writer.WriteIntValue("ttl", Ttl); + writer.WriteStringValue("type", Type); + writer.WriteIntValue("weight", Weight); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_a.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_a.cs new file mode 100644 index 0000000..feede78 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_a.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_a : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_a CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_a(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_aaaa.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_aaaa.cs new file mode 100644 index 0000000..dae7c43 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_aaaa.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_aaaa : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_aaaa CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_aaaa(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_caa.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_caa.cs new file mode 100644 index 0000000..d72b140 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_caa.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_caa : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_caa CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_caa(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_cname.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_cname.cs new file mode 100644 index 0000000..c8b2eea --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_cname.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_cname : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_cname CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_cname(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_mx.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_mx.cs new file mode 100644 index 0000000..f62eb1b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_mx.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_mx : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_mx CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_mx(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_ns.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_ns.cs new file mode 100644 index 0000000..a45c858 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_ns.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_ns : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_ns CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_ns(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_soa.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_soa.cs new file mode 100644 index 0000000..4df7025 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_soa.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_soa : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_soa CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_soa(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_srv.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_srv.cs new file mode 100644 index 0000000..6e838d6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_srv.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_srv : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_srv CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_srv(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_txt.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_txt.cs new file mode 100644 index 0000000..ab8c407 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Domain_record_txt.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Domain_record_txt : global::InfinityFlow.DigitalOcean.Client.Models.Domain_record, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_txt CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_txt(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet.cs new file mode 100644 index 0000000..b5783c7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet.cs @@ -0,0 +1,244 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BackupIds { get; set; } +#nullable restore +#else + public List BackupIds { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the Droplet was created. + public DateTimeOffset? CreatedAt { get; set; } + /// The size of the Droplet's disk in gigabytes. + public int? Disk { get; set; } + /// An array of objects containing information about the disks available to the Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DiskInfo { get; set; } +#nullable restore +#else + public List DiskInfo { get; set; } +#endif + /// An array of features enabled on this Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Features { get; set; } +#nullable restore +#else + public List Features { get; set; } +#endif + /// An object containing information about the GPU capabilities of Droplets created with this size. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info? GpuInfo { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info GpuInfo { get; set; } +#endif + /// A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation. + public int? Id { get; set; } + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Image? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Image Image { get; set; } +#endif + /// **Note**: All Droplets created after March 2017 use internal kernels by default.These Droplets will have this attribute set to `null`.The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/)for Droplets with externally managed kernels. This will initially be set tothe kernel of the base image when the Droplet is created. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kernel? Kernel { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kernel Kernel { get; set; } +#endif + /// A boolean value indicating whether the Droplet has been locked, preventing actions by users. + public bool? Locked { get; set; } + /// Memory of the Droplet in megabytes. + public int? Memory { get; set; } + /// The human-readable name set for the Droplet instance. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_networks? Networks { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_networks Networks { get; set; } +#endif + /// The next_backup_window property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window? NextBackupWindow { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window NextBackupWindow { get; set; } +#endif + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Region? Region { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Region Region { get; set; } +#endif + /// The size property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Size? Size { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Size Size { get; set; } +#endif + /// The unique slug identifier for the size of this Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SizeSlug { get; set; } +#nullable restore +#else + public string SizeSlug { get; set; } +#endif + /// An array of snapshot IDs of any snapshots created from the Droplet instance. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SnapshotIds { get; set; } +#nullable restore +#else + public List SnapshotIds { get; set; } +#endif + /// A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive". + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_status? Status { get; set; } + /// An array of Tags the Droplet has been tagged with. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// The number of virtual CPUs. + public int? Vcpus { get; set; } + /// A flat array including the unique identifier for each Block Storage volume attached to the Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VolumeIds { get; set; } +#nullable restore +#else + public List VolumeIds { get; set; } +#endif + /// A string specifying the UUID of the VPC to which the Droplet is assigned. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VpcUuid { get; set; } +#nullable restore +#else + public string VpcUuid { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Droplet() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "backup_ids", n => { BackupIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "disk", n => { Disk = n.GetIntValue(); } }, + { "disk_info", n => { DiskInfo = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Disk_info.CreateFromDiscriminatorValue)?.AsList(); } }, + { "features", n => { Features = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "gpu_info", n => { GpuInfo = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Image.CreateFromDiscriminatorValue); } }, + { "kernel", n => { Kernel = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kernel.CreateFromDiscriminatorValue); } }, + { "locked", n => { Locked = n.GetBoolValue(); } }, + { "memory", n => { Memory = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "networks", n => { Networks = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_networks.CreateFromDiscriminatorValue); } }, + { "next_backup_window", n => { NextBackupWindow = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window.CreateFromDiscriminatorValue); } }, + { "region", n => { Region = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Region.CreateFromDiscriminatorValue); } }, + { "size", n => { Size = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Size.CreateFromDiscriminatorValue); } }, + { "size_slug", n => { SizeSlug = n.GetStringValue(); } }, + { "snapshot_ids", n => { SnapshotIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "vcpus", n => { Vcpus = n.GetIntValue(); } }, + { "volume_ids", n => { VolumeIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "vpc_uuid", n => { VpcUuid = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("backup_ids", BackupIds); + writer.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteIntValue("disk", Disk); + writer.WriteCollectionOfObjectValues("disk_info", DiskInfo); + writer.WriteCollectionOfPrimitiveValues("features", Features); + writer.WriteObjectValue("gpu_info", GpuInfo); + writer.WriteIntValue("id", Id); + writer.WriteObjectValue("image", Image); + writer.WriteObjectValue("kernel", Kernel); + writer.WriteBoolValue("locked", Locked); + writer.WriteIntValue("memory", Memory); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("networks", Networks); + writer.WriteObjectValue("next_backup_window", NextBackupWindow); + writer.WriteObjectValue("region", Region); + writer.WriteObjectValue("size", Size); + writer.WriteStringValue("size_slug", SizeSlug); + writer.WriteCollectionOfPrimitiveValues("snapshot_ids", SnapshotIds); + writer.WriteEnumValue("status", Status); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteIntValue("vcpus", Vcpus); + writer.WriteCollectionOfPrimitiveValues("volume_ids", VolumeIds); + writer.WriteStringValue("vpc_uuid", VpcUuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action.cs new file mode 100644 index 0000000..299676f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Specifies the action that will be taken on the Droplet. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplet_action : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The type of action to initiate for the Droplet. + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Droplet_action() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_change_backup_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_change_backup_policy.cs new file mode 100644 index 0000000..946958a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_change_backup_policy.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_change_backup_policy : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// The backup_policy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy? BackupPolicy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy BackupPolicy { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_backup_policy CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_backup_policy(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "backup_policy", n => { BackupPolicy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("backup_policy", BackupPolicy); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_change_kernel.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_change_kernel.cs new file mode 100644 index 0000000..00c38f2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_change_kernel.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_change_kernel : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// A unique number used to identify and reference a specific kernel. + public int? Kernel { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_kernel CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_kernel(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "kernel", n => { Kernel = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("kernel", Kernel); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_enable_backups.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_enable_backups.cs new file mode 100644 index 0000000..1122d04 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_enable_backups.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_enable_backups : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// The backup_policy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy? BackupPolicy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy BackupPolicy { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_enable_backups CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_enable_backups(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "backup_policy", n => { BackupPolicy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("backup_policy", BackupPolicy); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_rebuild.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_rebuild.cs new file mode 100644 index 0000000..e9243b0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_rebuild.cs @@ -0,0 +1,117 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_rebuild : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// The image ID of a public or private image or the slug identifier for a public image. The Droplet will be rebuilt using this image as its base. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild.Droplet_action_rebuild_image? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild.Droplet_action_rebuild_image Image { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild.Droplet_action_rebuild_image.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("image", Image); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplet_action_rebuild_image : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type + public int? Integer { get; set; } + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild.Droplet_action_rebuild_image CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild.Droplet_action_rebuild_image(); + if(parseNode.GetIntValue() is int integerValue) + { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) + { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(Integer != null) + { + writer.WriteIntValue(null, Integer); + } + else if(String != null) + { + writer.WriteStringValue(null, String); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_rename.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_rename.cs new file mode 100644 index 0000000..10ee49e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_rename.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_rename : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// The new name for the Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rename CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rename(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("name", Name); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_resize.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_resize.cs new file mode 100644 index 0000000..9eb5010 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_resize.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_resize : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// When `true`, the Droplet's disk will be resized in addition to its RAM and CPU. This is a permanent change and cannot be reversed as a Droplet's disk size cannot be decreased. + public bool? Disk { get; set; } + /// The slug identifier for the size to which you wish to resize the Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Size { get; set; } +#nullable restore +#else + public string Size { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_resize CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_resize(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "disk", n => { Disk = n.GetBoolValue(); } }, + { "size", n => { Size = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteBoolValue("disk", Disk); + writer.WriteStringValue("size", Size); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_restore.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_restore.cs new file mode 100644 index 0000000..1097345 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_restore.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_restore : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// The ID of a backup of the current Droplet instance to restore from. + public int? Image { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_restore CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_restore(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "image", n => { Image = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("image", Image); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_snapshot.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_snapshot.cs new file mode 100644 index 0000000..67f0212 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_snapshot.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_action_snapshot : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action, IParsable + #pragma warning restore CS1591 + { + /// The name to give the new snapshot of the Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("name", Name); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_type.cs new file mode 100644 index 0000000..8f51ae7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_action_type.cs @@ -0,0 +1,71 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of action to initiate for the Droplet. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Droplet_action_type + { + [EnumMember(Value = "enable_backups")] + #pragma warning disable CS1591 + Enable_backups, + #pragma warning restore CS1591 + [EnumMember(Value = "disable_backups")] + #pragma warning disable CS1591 + Disable_backups, + #pragma warning restore CS1591 + [EnumMember(Value = "reboot")] + #pragma warning disable CS1591 + Reboot, + #pragma warning restore CS1591 + [EnumMember(Value = "power_cycle")] + #pragma warning disable CS1591 + Power_cycle, + #pragma warning restore CS1591 + [EnumMember(Value = "shutdown")] + #pragma warning disable CS1591 + Shutdown, + #pragma warning restore CS1591 + [EnumMember(Value = "power_off")] + #pragma warning disable CS1591 + Power_off, + #pragma warning restore CS1591 + [EnumMember(Value = "power_on")] + #pragma warning disable CS1591 + Power_on, + #pragma warning restore CS1591 + [EnumMember(Value = "restore")] + #pragma warning disable CS1591 + Restore, + #pragma warning restore CS1591 + [EnumMember(Value = "password_reset")] + #pragma warning disable CS1591 + Password_reset, + #pragma warning restore CS1591 + [EnumMember(Value = "resize")] + #pragma warning disable CS1591 + Resize, + #pragma warning restore CS1591 + [EnumMember(Value = "rebuild")] + #pragma warning disable CS1591 + Rebuild, + #pragma warning restore CS1591 + [EnumMember(Value = "rename")] + #pragma warning disable CS1591 + Rename, + #pragma warning restore CS1591 + [EnumMember(Value = "change_kernel")] + #pragma warning disable CS1591 + Change_kernel, + #pragma warning restore CS1591 + [EnumMember(Value = "enable_ipv6")] + #pragma warning disable CS1591 + Enable_ipv6, + #pragma warning restore CS1591 + [EnumMember(Value = "snapshot")] + #pragma warning disable CS1591 + Snapshot, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy.cs new file mode 100644 index 0000000..0567101 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_backup_policy : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The hour of the day that the backup window will start. + public int? Hour { get; set; } + /// The backup plan used for the Droplet. The plan can be either `daily` or `weekly`. + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy_plan? Plan { get; set; } + /// The number of days the backup will be retained. + public int? RetentionPeriodDays { get; private set; } + /// The day of the week on which the backup will occur. + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy_weekday? Weekday { get; set; } + /// The length of the backup window starting from `hour`. + public int? WindowLengthHours { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public Droplet_backup_policy() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "hour", n => { Hour = n.GetIntValue(); } }, + { "plan", n => { Plan = n.GetEnumValue(); } }, + { "retention_period_days", n => { RetentionPeriodDays = n.GetIntValue(); } }, + { "weekday", n => { Weekday = n.GetEnumValue(); } }, + { "window_length_hours", n => { WindowLengthHours = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("hour", Hour); + writer.WriteEnumValue("plan", Plan); + writer.WriteEnumValue("weekday", Weekday); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_plan.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_plan.cs new file mode 100644 index 0000000..1d0a902 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_plan.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The backup plan used for the Droplet. The plan can be either `daily` or `weekly`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Droplet_backup_policy_plan + { + [EnumMember(Value = "daily")] + #pragma warning disable CS1591 + Daily, + #pragma warning restore CS1591 + [EnumMember(Value = "weekly")] + #pragma warning disable CS1591 + Weekly, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_record.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_record.cs new file mode 100644 index 0000000..1408c40 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_record.cs @@ -0,0 +1,83 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_backup_policy_record : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether backups are enabled for the Droplet. + public bool? BackupEnabled { get; set; } + /// The backup_policy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy? BackupPolicy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy BackupPolicy { get; set; } +#endif + /// The unique identifier for the Droplet. + public int? DropletId { get; set; } + /// The next_backup_window property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window? NextBackupWindow { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window NextBackupWindow { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Droplet_backup_policy_record() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy_record CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy_record(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "backup_enabled", n => { BackupEnabled = n.GetBoolValue(); } }, + { "backup_policy", n => { BackupPolicy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy.CreateFromDiscriminatorValue); } }, + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + { "next_backup_window", n => { NextBackupWindow = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("backup_enabled", BackupEnabled); + writer.WriteObjectValue("backup_policy", BackupPolicy); + writer.WriteIntValue("droplet_id", DropletId); + writer.WriteObjectValue("next_backup_window", NextBackupWindow); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_weekday.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_weekday.cs new file mode 100644 index 0000000..dbd8fb1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_backup_policy_weekday.cs @@ -0,0 +1,39 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The day of the week on which the backup will occur. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Droplet_backup_policy_weekday + { + [EnumMember(Value = "SUN")] + #pragma warning disable CS1591 + SUN, + #pragma warning restore CS1591 + [EnumMember(Value = "MON")] + #pragma warning disable CS1591 + MON, + #pragma warning restore CS1591 + [EnumMember(Value = "TUE")] + #pragma warning disable CS1591 + TUE, + #pragma warning restore CS1591 + [EnumMember(Value = "WED")] + #pragma warning disable CS1591 + WED, + #pragma warning restore CS1591 + [EnumMember(Value = "THU")] + #pragma warning disable CS1591 + THU, + #pragma warning restore CS1591 + [EnumMember(Value = "FRI")] + #pragma warning disable CS1591 + FRI, + #pragma warning restore CS1591 + [EnumMember(Value = "SAT")] + #pragma warning disable CS1591 + SAT, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_create.cs new file mode 100644 index 0000000..e558ca4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_create.cs @@ -0,0 +1,227 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_create : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The backup_policy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy? BackupPolicy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy BackupPolicy { get; set; } +#endif + /// A boolean indicating whether automated backups should be enabled for the Droplet. + public bool? Backups { get; set; } + /// The image ID of a public or private image or the slug identifier for a public image. This image will be the base image for your Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create.Droplet_create_image? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create.Droplet_create_image Image { get; set; } +#endif + /// A boolean indicating whether to enable IPv6 on the Droplet. + public bool? Ipv6 { get; set; } + /// A boolean indicating whether to install the DigitalOcean agent for monitoring. + public bool? Monitoring { get; set; } + /// This parameter has been deprecated. Use `vpc_uuid` instead to specify a VPC network for the Droplet. If no `vpc_uuid` is provided, the Droplet will be placed in your account's default VPC for the region. + [Obsolete("")] + public bool? PrivateNetworking { get; set; } + /// The slug identifier for the region that you wish to deploy the Droplet in. If the specific datacenter is not not important, a slug prefix (e.g. `nyc`) can be used to deploy the Droplet in any of the that region's locations (`nyc1`, `nyc2`, or `nyc3`). If the region is omitted from the create request completely, the Droplet may deploy in any region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// The slug identifier for the size that you wish to select for this Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Size { get; set; } +#nullable restore +#else + public string Size { get; set; } +#endif + /// An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet's root account upon creation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SshKeys { get; set; } +#nullable restore +#else + public List SshKeys { get; set; } +#endif + /// A flat array of tag names as strings to apply to the Droplet after it is created. Tag names can either be existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// A string containing 'user data' which may be used to configure the Droplet on first boot, often a 'cloud-config' file or Bash script. It must be plain text and may not exceed 64 KiB in size. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserData { get; set; } +#nullable restore +#else + public string UserData { get; set; } +#endif + /// An array of IDs for block storage volumes that will be attached to the Droplet once created. The volumes must not already be attached to an existing Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Volumes { get; set; } +#nullable restore +#else + public List Volumes { get; set; } +#endif + /// A string specifying the UUID of the VPC to which the Droplet will be assigned. If excluded, the Droplet will be assigned to your account's default VPC for the region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VpcUuid { get; set; } +#nullable restore +#else + public string VpcUuid { get; set; } +#endif + /// A boolean indicating whether to install the DigitalOcean agent used for providing access to the Droplet web console in the control panel. By default, the agent is installed on new Droplets but installation errors (i.e. OS not supported) are ignored. To prevent it from being installed, set to `false`. To make installation errors fatal, explicitly set it to `true`. + public bool? WithDropletAgent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Droplet_create() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "backup_policy", n => { BackupPolicy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_backup_policy.CreateFromDiscriminatorValue); } }, + { "backups", n => { Backups = n.GetBoolValue(); } }, + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create.Droplet_create_image.CreateFromDiscriminatorValue); } }, + { "ipv6", n => { Ipv6 = n.GetBoolValue(); } }, + { "monitoring", n => { Monitoring = n.GetBoolValue(); } }, + { "private_networking", n => { PrivateNetworking = n.GetBoolValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "size", n => { Size = n.GetStringValue(); } }, + { "ssh_keys", n => { SshKeys = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "user_data", n => { UserData = n.GetStringValue(); } }, + { "volumes", n => { Volumes = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "vpc_uuid", n => { VpcUuid = n.GetStringValue(); } }, + { "with_droplet_agent", n => { WithDropletAgent = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("backup_policy", BackupPolicy); + writer.WriteBoolValue("backups", Backups); + writer.WriteObjectValue("image", Image); + writer.WriteBoolValue("ipv6", Ipv6); + writer.WriteBoolValue("monitoring", Monitoring); + writer.WriteBoolValue("private_networking", PrivateNetworking); + writer.WriteStringValue("region", Region); + writer.WriteStringValue("size", Size); + writer.WriteCollectionOfPrimitiveValues("ssh_keys", SshKeys); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteStringValue("user_data", UserData); + writer.WriteCollectionOfPrimitiveValues("volumes", Volumes); + writer.WriteStringValue("vpc_uuid", VpcUuid); + writer.WriteBoolValue("with_droplet_agent", WithDropletAgent); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplet_create_image : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type + public int? Integer { get; set; } + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create.Droplet_create_image CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create.Droplet_create_image(); + if(parseNode.GetIntValue() is int integerValue) + { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) + { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(Integer != null) + { + writer.WriteIntValue(null, Integer); + } + else if(String != null) + { + writer.WriteStringValue(null, String); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_multi_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_multi_create.cs new file mode 100644 index 0000000..8335355 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_multi_create.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_multi_create : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create, IParsable + #pragma warning restore CS1591 + { + /// An array of human human-readable strings you wish to use when displaying the Droplet name. Each name, if set to a domain name managed in the DigitalOcean DNS management system, will configure a PTR record for the Droplet. Each name set during creation will also determine the hostname for the Droplet in its internal configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Names { get; set; } +#nullable restore +#else + public List Names { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_multi_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_multi_create(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "names", n => { Names = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfPrimitiveValues("names", Names); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_networks.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_networks.cs new file mode 100644 index 0000000..b485d90 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_networks.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplet_networks : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The v4 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? V4 { get; set; } +#nullable restore +#else + public List V4 { get; set; } +#endif + /// The v6 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? V6 { get; set; } +#nullable restore +#else + public List V6 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Droplet_networks() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_networks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_networks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "v4", n => { V4 = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Network_v4.CreateFromDiscriminatorValue)?.AsList(); } }, + { "v6", n => { V6 = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Network_v6.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("v4", V4); + writer.WriteCollectionOfObjectValues("v6", V6); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_next_backup_window.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_next_backup_window.cs new file mode 100644 index 0000000..1bd4c87 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_next_backup_window.cs @@ -0,0 +1,63 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_next_backup_window : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window. + public DateTimeOffset? End { get; set; } + /// A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window. + public DateTimeOffset? Start { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Droplet_next_backup_window() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_next_backup_window(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "end", n => { End = n.GetDateTimeOffsetValue(); } }, + { "start", n => { Start = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("end", End); + writer.WriteDateTimeOffsetValue("start", Start); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_single_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_single_create.cs new file mode 100644 index 0000000..87c378d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_single_create.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_single_create : global::InfinityFlow.DigitalOcean.Client.Models.Droplet_create, IParsable + #pragma warning restore CS1591 + { + /// The human-readable string you wish to use when displaying the Droplet name. The name, if set to a domain name managed in the DigitalOcean DNS management system, will configure a PTR record for the Droplet. The name set during creation will also determine the hostname for the Droplet in its internal configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_single_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_single_create(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("name", Name); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_snapshot.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_snapshot.cs new file mode 100644 index 0000000..74d3e47 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_snapshot.cs @@ -0,0 +1,54 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Droplet_snapshot : global::InfinityFlow.DigitalOcean.Client.Models.Snapshots_base, IParsable + #pragma warning restore CS1591 + { + /// The unique identifier for the snapshot or backup. + public int? Id { get; set; } + /// Describes the kind of image. It may be one of `snapshot` or `backup`. This specifies whether an image is a user-generated Droplet snapshot or automatically created Droplet backup. + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_snapshot_type? Type { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_snapshot CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_snapshot(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "id", n => { Id = n.GetIntValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_snapshot_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_snapshot_type.cs new file mode 100644 index 0000000..01c9ee9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_snapshot_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Describes the kind of image. It may be one of `snapshot` or `backup`. This specifies whether an image is a user-generated Droplet snapshot or automatically created Droplet backup. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Droplet_snapshot_type + { + [EnumMember(Value = "snapshot")] + #pragma warning disable CS1591 + Snapshot, + #pragma warning restore CS1591 + [EnumMember(Value = "backup")] + #pragma warning disable CS1591 + Backup, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_status.cs new file mode 100644 index 0000000..d5f17db --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Droplet_status.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive". + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Droplet_status + { + [EnumMember(Value = "new")] + #pragma warning disable CS1591 + New, + #pragma warning restore CS1591 + [EnumMember(Value = "active")] + #pragma warning disable CS1591 + Active, + #pragma warning restore CS1591 + [EnumMember(Value = "off")] + #pragma warning disable CS1591 + Off, + #pragma warning restore CS1591 + [EnumMember(Value = "archive")] + #pragma warning disable CS1591 + Archive, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Elasticsearch_logsink.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Elasticsearch_logsink.cs new file mode 100644 index 0000000..7be49a8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Elasticsearch_logsink.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Elasticsearch_logsink : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// PEM encoded CA certificate +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ca { get; set; } +#nullable restore +#else + public string Ca { get; set; } +#endif + /// Maximum number of days of logs to keep + public int? IndexDaysMax { get; set; } + /// Elasticsearch index prefix +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexPrefix { get; set; } +#nullable restore +#else + public string IndexPrefix { get; set; } +#endif + /// Elasticsearch request timeout limit + public float? Timeout { get; set; } + /// Elasticsearch connection URL +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Elasticsearch_logsink() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ca", n => { Ca = n.GetStringValue(); } }, + { "index_days_max", n => { IndexDaysMax = n.GetIntValue(); } }, + { "index_prefix", n => { IndexPrefix = n.GetStringValue(); } }, + { "timeout", n => { Timeout = n.GetFloatValue(); } }, + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("ca", Ca); + writer.WriteIntValue("index_days_max", IndexDaysMax); + writer.WriteStringValue("index_prefix", IndexPrefix); + writer.WriteFloatValue("timeout", Timeout); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Error.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Error.cs new file mode 100644 index 0000000..542d8ab --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Error.cs @@ -0,0 +1,88 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Error : ApiException, IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found." +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The primary error message. + public override string Message { get => MessageEscaped ?? string.Empty; } + /// A message providing additional information about the error, including details to help resolve it when possible. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MessageEscaped { get; set; } +#nullable restore +#else + public string MessageEscaped { get; set; } +#endif + /// Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RequestId { get; set; } +#nullable restore +#else + public string RequestId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Error() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Error CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Error(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "message", n => { MessageEscaped = n.GetStringValue(); } }, + { "request_id", n => { RequestId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("message", MessageEscaped); + writer.WriteStringValue("request_id", RequestId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Error_with_root_causes.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Error_with_root_causes.cs new file mode 100644 index 0000000..9ef0528 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Error_with_root_causes.cs @@ -0,0 +1,88 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Error_with_root_causes : ApiException, IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A message providing information about the error. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Error { get; set; } +#nullable restore +#else + public string Error { get; set; } +#endif + /// The primary error message. + public override string Message { get => base.Message; } + /// A list of error messages. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Messages { get; set; } +#nullable restore +#else + public List Messages { get; set; } +#endif + /// A list of underlying causes for the error, including details to help resolve it when possible. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? RootCauses { get; set; } +#nullable restore +#else + public List RootCauses { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Error_with_root_causes() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Error_with_root_causes CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Error_with_root_causes(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "error", n => { Error = n.GetStringValue(); } }, + { "messages", n => { Messages = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "root_causes", n => { RootCauses = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("error", Error); + writer.WriteCollectionOfPrimitiveValues("messages", Messages); + writer.WriteCollectionOfPrimitiveValues("root_causes", RootCauses); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Events_logs.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Events_logs.cs new file mode 100644 index 0000000..049e800 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Events_logs.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Events_logs : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterName { get; set; } +#nullable restore +#else + public string ClusterName { get; set; } +#endif + /// The time of the generation of a event. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreateTime { get; set; } +#nullable restore +#else + public string CreateTime { get; set; } +#endif + /// Type of the event. + public global::InfinityFlow.DigitalOcean.Client.Models.Events_logs_event_type? EventType { get; set; } + /// ID of the particular event. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Events_logs() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Events_logs CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Events_logs(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cluster_name", n => { ClusterName = n.GetStringValue(); } }, + { "create_time", n => { CreateTime = n.GetStringValue(); } }, + { "event_type", n => { EventType = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cluster_name", ClusterName); + writer.WriteStringValue("create_time", CreateTime); + writer.WriteEnumValue("event_type", EventType); + writer.WriteStringValue("id", Id); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Events_logs_event_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Events_logs_event_type.cs new file mode 100644 index 0000000..9fbf4e3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Events_logs_event_type.cs @@ -0,0 +1,39 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Type of the event. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Events_logs_event_type + { + [EnumMember(Value = "cluster_maintenance_perform")] + #pragma warning disable CS1591 + Cluster_maintenance_perform, + #pragma warning restore CS1591 + [EnumMember(Value = "cluster_master_promotion")] + #pragma warning disable CS1591 + Cluster_master_promotion, + #pragma warning restore CS1591 + [EnumMember(Value = "cluster_create")] + #pragma warning disable CS1591 + Cluster_create, + #pragma warning restore CS1591 + [EnumMember(Value = "cluster_update")] + #pragma warning disable CS1591 + Cluster_update, + #pragma warning restore CS1591 + [EnumMember(Value = "cluster_delete")] + #pragma warning disable CS1591 + Cluster_delete, + #pragma warning restore CS1591 + [EnumMember(Value = "cluster_poweron")] + #pragma warning disable CS1591 + Cluster_poweron, + #pragma warning restore CS1591 + [EnumMember(Value = "cluster_poweroff")] + #pragma warning disable CS1591 + Cluster_poweroff, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Eviction_policy_model.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Eviction_policy_model.cs new file mode 100644 index 0000000..53e9d25 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Eviction_policy_model.cs @@ -0,0 +1,35 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string specifying the desired eviction policy for the Redis cluster.- `noeviction`: Don't evict any data, returns error when memory limit is reached.- `allkeys_lru:` Evict any key, least recently used (LRU) first.- `allkeys_random`: Evict keys in a random order.- `volatile_lru`: Evict keys with expiration only, least recently used (LRU) first.- `volatile_random`: Evict keys with expiration only in a random order.- `volatile_ttl`: Evict keys with expiration only, shortest time-to-live (TTL) first. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Eviction_policy_model + { + [EnumMember(Value = "noeviction")] + #pragma warning disable CS1591 + Noeviction, + #pragma warning restore CS1591 + [EnumMember(Value = "allkeys_lru")] + #pragma warning disable CS1591 + Allkeys_lru, + #pragma warning restore CS1591 + [EnumMember(Value = "allkeys_random")] + #pragma warning disable CS1591 + Allkeys_random, + #pragma warning restore CS1591 + [EnumMember(Value = "volatile_lru")] + #pragma warning disable CS1591 + Volatile_lru, + #pragma warning restore CS1591 + [EnumMember(Value = "volatile_random")] + #pragma warning disable CS1591 + Volatile_random, + #pragma warning restore CS1591 + [EnumMember(Value = "volatile_ttl")] + #pragma warning disable CS1591 + Volatile_ttl, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall.cs new file mode 100644 index 0000000..67bffc5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall.cs @@ -0,0 +1,100 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall : global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules, IParsable + #pragma warning restore CS1591 + { + /// A time value given in ISO8601 combined date and time format that represents when the firewall was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// An array containing the IDs of the Droplets assigned to the firewall. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; set; } +#nullable restore +#else + public List DropletIds { get; set; } +#endif + /// A unique ID that can be used to identify and reference a firewall. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; private set; } +#nullable restore +#else + public string Id { get; private set; } +#endif + /// A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PendingChanges { get; private set; } +#nullable restore +#else + public List PendingChanges { get; private set; } +#endif + /// A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall_status? Status { get; private set; } + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Firewall CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "pending_changes", n => { PendingChanges = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_pending_changes.CreateFromDiscriminatorValue)?.AsList(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfPrimitiveValues("droplet_ids", DropletIds); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_pending_changes.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_pending_changes.cs new file mode 100644 index 0000000..4a34540 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_pending_changes.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall_pending_changes : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplet_id property + public int? DropletId { get; set; } + /// The removing property + public bool? Removing { get; set; } + /// The status property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Status { get; set; } +#nullable restore +#else + public string Status { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Firewall_pending_changes() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Firewall_pending_changes CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_pending_changes(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + { "removing", n => { Removing = n.GetBoolValue(); } }, + { "status", n => { Status = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("droplet_id", DropletId); + writer.WriteBoolValue("removing", Removing); + writer.WriteStringValue("status", Status); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule.cs new file mode 100644 index 0000000..cbf2cf3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule.cs @@ -0,0 +1,91 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall_rule : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A unique ID for the database cluster to which the rule is applied. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterUuid { get; private set; } +#nullable restore +#else + public string ClusterUuid { get; private set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the firewall rule was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// The type of resource that the firewall rule allows to access the database cluster. + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_type? Type { get; set; } + /// A unique ID for the firewall rule itself. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uuid { get; set; } +#nullable restore +#else + public string Uuid { get; set; } +#endif + /// The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Firewall_rule() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cluster_uuid", n => { ClusterUuid = n.GetStringValue(); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + { "uuid", n => { Uuid = n.GetStringValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteStringValue("uuid", Uuid); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_base.cs new file mode 100644 index 0000000..d14f3f1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_base.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall_rule_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ports { get; set; } +#nullable restore +#else + public string Ports { get; set; } +#endif + /// The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_base_protocol? Protocol { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Firewall_rule_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ports", n => { Ports = n.GetStringValue(); } }, + { "protocol", n => { Protocol = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("ports", Ports); + writer.WriteEnumValue("protocol", Protocol); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_base_protocol.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_base_protocol.cs new file mode 100644 index 0000000..9ead694 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_base_protocol.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Firewall_rule_base_protocol + { + [EnumMember(Value = "tcp")] + #pragma warning disable CS1591 + Tcp, + #pragma warning restore CS1591 + [EnumMember(Value = "udp")] + #pragma warning disable CS1591 + Udp, + #pragma warning restore CS1591 + [EnumMember(Value = "icmp")] + #pragma warning disable CS1591 + Icmp, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_target.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_target.cs new file mode 100644 index 0000000..5fad8d7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_target.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall_rule_target : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Addresses { get; set; } +#nullable restore +#else + public List Addresses { get; set; } +#endif + /// An array containing the IDs of the Droplets to which the firewall will allow traffic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; set; } +#nullable restore +#else + public List DropletIds { get; set; } +#endif + /// An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? KubernetesIds { get; set; } +#nullable restore +#else + public List KubernetesIds { get; set; } +#endif + /// An array containing the IDs of the load balancers to which the firewall will allow traffic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LoadBalancerUids { get; set; } +#nullable restore +#else + public List LoadBalancerUids { get; set; } +#endif + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Firewall_rule_target() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "addresses", n => { Addresses = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "kubernetes_ids", n => { KubernetesIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "load_balancer_uids", n => { LoadBalancerUids = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("addresses", Addresses); + writer.WriteCollectionOfPrimitiveValues("droplet_ids", DropletIds); + writer.WriteCollectionOfPrimitiveValues("kubernetes_ids", KubernetesIds); + writer.WriteCollectionOfPrimitiveValues("load_balancer_uids", LoadBalancerUids); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_type.cs new file mode 100644 index 0000000..535e25d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rule_type.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of resource that the firewall rule allows to access the database cluster. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Firewall_rule_type + { + [EnumMember(Value = "droplet")] + #pragma warning disable CS1591 + Droplet, + #pragma warning restore CS1591 + [EnumMember(Value = "k8s")] + #pragma warning disable CS1591 + K8s, + #pragma warning restore CS1591 + [EnumMember(Value = "ip_addr")] + #pragma warning disable CS1591 + Ip_addr, + #pragma warning restore CS1591 + [EnumMember(Value = "tag")] + #pragma warning disable CS1591 + Tag, + #pragma warning restore CS1591 + [EnumMember(Value = "app")] + #pragma warning disable CS1591 + App, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules.cs new file mode 100644 index 0000000..6bb0612 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall_rules : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inbound_rules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? InboundRules { get; set; } +#nullable restore +#else + public List InboundRules { get; set; } +#endif + /// The outbound_rules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? OutboundRules { get; set; } +#nullable restore +#else + public List OutboundRules { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Firewall_rules() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inbound_rules", n => { InboundRules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules_inbound_rules.CreateFromDiscriminatorValue)?.AsList(); } }, + { "outbound_rules", n => { OutboundRules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules_outbound_rules.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("inbound_rules", InboundRules); + writer.WriteCollectionOfObjectValues("outbound_rules", OutboundRules); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules_inbound_rules.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules_inbound_rules.cs new file mode 100644 index 0000000..090391a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules_inbound_rules.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall_rules_inbound_rules : global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_base, IParsable + #pragma warning restore CS1591 + { + /// The sources property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target? Sources { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target Sources { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules_inbound_rules CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules_inbound_rules(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "sources", n => { Sources = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("sources", Sources); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules_outbound_rules.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules_outbound_rules.cs new file mode 100644 index 0000000..90fcbfe --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_rules_outbound_rules.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Firewall_rules_outbound_rules : global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_base, IParsable + #pragma warning restore CS1591 + { + /// The destinations property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target? Destinations { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target Destinations { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules_outbound_rules CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules_outbound_rules(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "destinations", n => { Destinations = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule_target.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("destinations", Destinations); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_status.cs new file mode 100644 index 0000000..b9b6ca2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Firewall_status.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Firewall_status + { + [EnumMember(Value = "waiting")] + #pragma warning disable CS1591 + Waiting, + #pragma warning restore CS1591 + [EnumMember(Value = "succeeded")] + #pragma warning disable CS1591 + Succeeded, + #pragma warning restore CS1591 + [EnumMember(Value = "failed")] + #pragma warning disable CS1591 + Failed, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/FloatingIPsAction.cs b/src/InfinityFlow.DigitalOcean.Client/Models/FloatingIPsAction.cs new file mode 100644 index 0000000..2b18821 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/FloatingIPsAction.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FloatingIPsAction : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The type of action to initiate for the floating IP. + public global::InfinityFlow.DigitalOcean.Client.Models.FloatingIPsAction_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public FloatingIPsAction() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.FloatingIPsAction CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); + return mappingValue switch + { + "assign" => new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_assign(), + "unassign" => new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_unassign(), + _ => new global::InfinityFlow.DigitalOcean.Client.Models.FloatingIPsAction(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/FloatingIPsAction_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/FloatingIPsAction_type.cs new file mode 100644 index 0000000..42e450b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/FloatingIPsAction_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of action to initiate for the floating IP. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum FloatingIPsAction_type + { + [EnumMember(Value = "assign")] + #pragma warning disable CS1591 + Assign, + #pragma warning restore CS1591 + [EnumMember(Value = "unassign")] + #pragma warning disable CS1591 + Unassign, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip.cs new file mode 100644 index 0000000..61f910c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ip : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet? Droplet { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet Droplet { get; set; } +#endif + /// The public IP address of the floating IP. It also serves as its identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ip { get; set; } +#nullable restore +#else + public string Ip { get; set; } +#endif + /// A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted. + public bool? Locked { get; set; } + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Region? Region { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Region Region { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Floating_ip() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet", n => { Droplet = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet.CreateFromDiscriminatorValue); } }, + { "ip", n => { Ip = n.GetStringValue(); } }, + { "locked", n => { Locked = n.GetBoolValue(); } }, + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + { "region", n => { Region = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Region.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("droplet", Droplet); + writer.WriteStringValue("ip", Ip); + writer.WriteBoolValue("locked", Locked); + writer.WriteGuidValue("project_id", ProjectId); + writer.WriteObjectValue("region", Region); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_action_assign.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_action_assign.cs new file mode 100644 index 0000000..877a34a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_action_assign.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ip_action_assign : global::InfinityFlow.DigitalOcean.Client.Models.FloatingIPsAction, IParsable + #pragma warning restore CS1591 + { + /// The ID of the Droplet that the floating IP will be assigned to. + public int? DropletId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_assign CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_assign(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("droplet_id", DropletId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_action_unassign.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_action_unassign.cs new file mode 100644 index 0000000..0a29642 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_action_unassign.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ip_action_unassign : global::InfinityFlow.DigitalOcean.Client.Models.FloatingIPsAction, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_unassign CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_unassign(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_create.cs new file mode 100644 index 0000000..2804caa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_create.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Floating_ip_create : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1? FloatingIpCreateMember1 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1 FloatingIpCreateMember1 { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2? FloatingIpCreateMember2 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2 FloatingIpCreateMember2 { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_create(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.FloatingIpCreateMember1 = new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1(); + } + else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.FloatingIpCreateMember2 = new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(FloatingIpCreateMember1 != null) + { + return FloatingIpCreateMember1.GetFieldDeserializers(); + } + else if(FloatingIpCreateMember2 != null) + { + return FloatingIpCreateMember2.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(FloatingIpCreateMember1 != null) + { + writer.WriteObjectValue(null, FloatingIpCreateMember1); + } + else if(FloatingIpCreateMember2 != null) + { + writer.WriteObjectValue(null, FloatingIpCreateMember2); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_createMember1.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_createMember1.cs new file mode 100644 index 0000000..3b30208 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_createMember1.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ip_createMember1 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the Droplet that the floating IP will be assigned to. + public int? DropletId { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Floating_ip_createMember1() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("droplet_id", DropletId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_createMember2.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_createMember2.cs new file mode 100644 index 0000000..9284827 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Floating_ip_createMember2.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ip_createMember2 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The UUID of the project to which the floating IP will be assigned. + public Guid? ProjectId { get; set; } + /// The slug identifier for the region the floating IP will be reserved to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Floating_ip_createMember2() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("project_id", ProjectId); + writer.WriteStringValue("region", Region); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Forward_links.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Forward_links.cs new file mode 100644 index 0000000..2d1f101 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Forward_links.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Forward_links : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// URI of the last page of the results. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Last { get; set; } +#nullable restore +#else + public string Last { get; set; } +#endif + /// URI of the next page of the results. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Next { get; set; } +#nullable restore +#else + public string Next { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Forward_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Forward_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Forward_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("last", Last); + writer.WriteStringValue("next", Next); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule.cs new file mode 100644 index 0000000..4da9c1a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object specifying a forwarding rule for a load balancer. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Forwarding_rule : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the TLS certificate used for SSL termination if enabled. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CertificateId { get; set; } +#nullable restore +#else + public string CertificateId { get; set; } +#endif + /// An integer representing the port on which the load balancer instance will listen. + public int? EntryPort { get; set; } + /// The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. + public global::InfinityFlow.DigitalOcean.Client.Models.Forwarding_rule_entry_protocol? EntryProtocol { get; set; } + /// An integer representing the port on the backend Droplets to which the load balancer will send traffic. + public int? TargetPort { get; set; } + /// The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. + public global::InfinityFlow.DigitalOcean.Client.Models.Forwarding_rule_target_protocol? TargetProtocol { get; set; } + /// A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. + public bool? TlsPassthrough { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Forwarding_rule() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Forwarding_rule CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Forwarding_rule(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate_id", n => { CertificateId = n.GetStringValue(); } }, + { "entry_port", n => { EntryPort = n.GetIntValue(); } }, + { "entry_protocol", n => { EntryProtocol = n.GetEnumValue(); } }, + { "target_port", n => { TargetPort = n.GetIntValue(); } }, + { "target_protocol", n => { TargetProtocol = n.GetEnumValue(); } }, + { "tls_passthrough", n => { TlsPassthrough = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("certificate_id", CertificateId); + writer.WriteIntValue("entry_port", EntryPort); + writer.WriteEnumValue("entry_protocol", EntryProtocol); + writer.WriteIntValue("target_port", TargetPort); + writer.WriteEnumValue("target_protocol", TargetProtocol); + writer.WriteBoolValue("tls_passthrough", TlsPassthrough); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule_entry_protocol.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule_entry_protocol.cs new file mode 100644 index 0000000..1c8d37f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule_entry_protocol.cs @@ -0,0 +1,35 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Forwarding_rule_entry_protocol + { + [EnumMember(Value = "http")] + #pragma warning disable CS1591 + Http, + #pragma warning restore CS1591 + [EnumMember(Value = "https")] + #pragma warning disable CS1591 + Https, + #pragma warning restore CS1591 + [EnumMember(Value = "http2")] + #pragma warning disable CS1591 + Http2, + #pragma warning restore CS1591 + [EnumMember(Value = "http3")] + #pragma warning disable CS1591 + Http3, + #pragma warning restore CS1591 + [EnumMember(Value = "tcp")] + #pragma warning disable CS1591 + Tcp, + #pragma warning restore CS1591 + [EnumMember(Value = "udp")] + #pragma warning disable CS1591 + Udp, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule_target_protocol.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule_target_protocol.cs new file mode 100644 index 0000000..57e58f8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Forwarding_rule_target_protocol.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Forwarding_rule_target_protocol + { + [EnumMember(Value = "http")] + #pragma warning disable CS1591 + Http, + #pragma warning restore CS1591 + [EnumMember(Value = "https")] + #pragma warning disable CS1591 + Https, + #pragma warning restore CS1591 + [EnumMember(Value = "http2")] + #pragma warning disable CS1591 + Http2, + #pragma warning restore CS1591 + [EnumMember(Value = "tcp")] + #pragma warning disable CS1591 + Tcp, + #pragma warning restore CS1591 + [EnumMember(Value = "udp")] + #pragma warning disable CS1591 + Udp, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Garbage_collection.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Garbage_collection.cs new file mode 100644 index 0000000..d9eb8fd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Garbage_collection.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Garbage_collection : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of blobs deleted as a result of this garbage collection. + public int? BlobsDeleted { get; set; } + /// The time the garbage collection was created. + public DateTimeOffset? CreatedAt { get; set; } + /// The number of bytes freed as a result of this garbage collection. + public int? FreedBytes { get; set; } + /// The name of the container registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RegistryName { get; set; } +#nullable restore +#else + public string RegistryName { get; set; } +#endif + /// The current status of this garbage collection. + public global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection_status? Status { get; set; } + /// The time the garbage collection was last updated. + public DateTimeOffset? UpdatedAt { get; set; } + /// A string specifying the UUID of the garbage collection. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uuid { get; set; } +#nullable restore +#else + public string Uuid { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Garbage_collection() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "blobs_deleted", n => { BlobsDeleted = n.GetIntValue(); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "freed_bytes", n => { FreedBytes = n.GetIntValue(); } }, + { "registry_name", n => { RegistryName = n.GetStringValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + { "uuid", n => { Uuid = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("blobs_deleted", BlobsDeleted); + writer.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteIntValue("freed_bytes", FreedBytes); + writer.WriteStringValue("registry_name", RegistryName); + writer.WriteEnumValue("status", Status); + writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); + writer.WriteStringValue("uuid", Uuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Garbage_collection_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Garbage_collection_status.cs new file mode 100644 index 0000000..f2bf0c5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Garbage_collection_status.cs @@ -0,0 +1,43 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The current status of this garbage collection. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Garbage_collection_status + { + [EnumMember(Value = "requested")] + #pragma warning disable CS1591 + Requested, + #pragma warning restore CS1591 + [EnumMember(Value = "waiting for write JWTs to expire")] + #pragma warning disable CS1591 + WaitingForWriteJWTsToExpire, + #pragma warning restore CS1591 + [EnumMember(Value = "scanning manifests")] + #pragma warning disable CS1591 + ScanningManifests, + #pragma warning restore CS1591 + [EnumMember(Value = "deleting unreferenced blobs")] + #pragma warning disable CS1591 + DeletingUnreferencedBlobs, + #pragma warning restore CS1591 + [EnumMember(Value = "cancelling")] + #pragma warning disable CS1591 + Cancelling, + #pragma warning restore CS1591 + [EnumMember(Value = "failed")] + #pragma warning disable CS1591 + Failed, + #pragma warning restore CS1591 + [EnumMember(Value = "succeeded")] + #pragma warning disable CS1591 + Succeeded, + #pragma warning restore CS1591 + [EnumMember(Value = "cancelled")] + #pragma warning disable CS1591 + Cancelled, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Gpu_info.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Gpu_info.cs new file mode 100644 index 0000000..f968089 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Gpu_info.cs @@ -0,0 +1,80 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing information about the GPU capabilities of Droplets created with this size. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Gpu_info : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of GPUs allocated to the Droplet. + public int? Count { get; set; } + /// The model of the GPU. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The vram property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info_vram? Vram { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info_vram Vram { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Gpu_info() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "count", n => { Count = n.GetIntValue(); } }, + { "model", n => { Model = n.GetStringValue(); } }, + { "vram", n => { Vram = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info_vram.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("count", Count); + writer.WriteStringValue("model", Model); + writer.WriteObjectValue("vram", Vram); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Gpu_info_vram.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Gpu_info_vram.cs new file mode 100644 index 0000000..da4490d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Gpu_info_vram.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Gpu_info_vram : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The amount of VRAM allocated to the GPU. + public int? Amount { get; set; } + /// The unit of measure for the VRAM. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Unit { get; set; } +#nullable restore +#else + public string Unit { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Gpu_info_vram() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info_vram CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info_vram(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetIntValue(); } }, + { "unit", n => { Unit = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("amount", Amount); + writer.WriteStringValue("unit", Unit); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Health_check.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Health_check.cs new file mode 100644 index 0000000..629a95c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Health_check.cs @@ -0,0 +1,92 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object specifying health check settings for the load balancer. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Health_check : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of seconds between between two consecutive health checks. + public int? CheckIntervalSeconds { get; set; } + /// The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. + public int? HealthyThreshold { get; set; } + /// The path on the backend Droplets to which the load balancer instance will send a request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// An integer representing the port on the backend Droplets on which the health check will attempt a connection. + public int? Port { get; set; } + /// The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. + public global::InfinityFlow.DigitalOcean.Client.Models.Health_check_protocol? Protocol { get; set; } + /// The number of seconds the load balancer instance will wait for a response until marking a health check as failed. + public int? ResponseTimeoutSeconds { get; set; } + /// The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. + public int? UnhealthyThreshold { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Health_check() + { + AdditionalData = new Dictionary(); + Path = "/"; + Protocol = global::InfinityFlow.DigitalOcean.Client.Models.Health_check_protocol.Http; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Health_check CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Health_check(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "check_interval_seconds", n => { CheckIntervalSeconds = n.GetIntValue(); } }, + { "healthy_threshold", n => { HealthyThreshold = n.GetIntValue(); } }, + { "path", n => { Path = n.GetStringValue(); } }, + { "port", n => { Port = n.GetIntValue(); } }, + { "protocol", n => { Protocol = n.GetEnumValue(); } }, + { "response_timeout_seconds", n => { ResponseTimeoutSeconds = n.GetIntValue(); } }, + { "unhealthy_threshold", n => { UnhealthyThreshold = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("check_interval_seconds", CheckIntervalSeconds); + writer.WriteIntValue("healthy_threshold", HealthyThreshold); + writer.WriteStringValue("path", Path); + writer.WriteIntValue("port", Port); + writer.WriteEnumValue("protocol", Protocol); + writer.WriteIntValue("response_timeout_seconds", ResponseTimeoutSeconds); + writer.WriteIntValue("unhealthy_threshold", UnhealthyThreshold); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Health_check_protocol.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Health_check_protocol.cs new file mode 100644 index 0000000..c34cddc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Health_check_protocol.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Health_check_protocol + { + [EnumMember(Value = "http")] + #pragma warning disable CS1591 + Http, + #pragma warning restore CS1591 + [EnumMember(Value = "https")] + #pragma warning disable CS1591 + Https, + #pragma warning restore CS1591 + [EnumMember(Value = "tcp")] + #pragma warning disable CS1591 + Tcp, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image.cs new file mode 100644 index 0000000..e8355d3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image.cs @@ -0,0 +1,146 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Image : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the image was created. + public DateTimeOffset? CreatedAt { get; set; } + /// An optional free-form text field to describe an image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place. + public global::InfinityFlow.DigitalOcean.Client.Models.Distribution? Distribution { get; set; } + /// A string containing information about errors that may occur when importing a custom image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ErrorMessage { get; set; } +#nullable restore +#else + public string ErrorMessage { get; set; } +#endif + /// A unique number that can be used to identify and reference a specific image. + public int? Id { get; private set; } + /// The minimum disk size in GB required for a Droplet to use this image. + public int? MinDiskSize { get; set; } + /// The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account. + public bool? Public { get; set; } + /// This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// The size of the image in gigabytes. + public float? SizeGigabytes { get; set; } + /// A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// A status string indicating the state of a custom image. This may be `NEW`, `available`, `pending`, `deleted`, or `retired`. + public global::InfinityFlow.DigitalOcean.Client.Models.Image_status? Status { get; set; } + /// A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes). + public global::InfinityFlow.DigitalOcean.Client.Models.Image_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Image() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Image CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Image(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "distribution", n => { Distribution = n.GetEnumValue(); } }, + { "error_message", n => { ErrorMessage = n.GetStringValue(); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "min_disk_size", n => { MinDiskSize = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "public", n => { Public = n.GetBoolValue(); } }, + { "regions", n => { Regions = n.GetCollectionOfEnumValues()?.AsList(); } }, + { "size_gigabytes", n => { SizeGigabytes = n.GetFloatValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteStringValue("description", Description); + writer.WriteEnumValue("distribution", Distribution); + writer.WriteStringValue("error_message", ErrorMessage); + writer.WriteIntValue("min_disk_size", MinDiskSize); + writer.WriteStringValue("name", Name); + writer.WriteBoolValue("public", Public); + writer.WriteCollectionOfEnumValues("regions", Regions); + writer.WriteFloatValue("size_gigabytes", SizeGigabytes); + writer.WriteStringValue("slug", Slug); + writer.WriteEnumValue("status", Status); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_base.cs new file mode 100644 index 0000000..531e91e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_base.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Image_action_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The action to be taken on the image. Can be either `convert` or `transfer`. + public global::InfinityFlow.DigitalOcean.Client.Models.Image_action_base_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Image_action_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Image_action_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Image_action_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_base_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_base_type.cs new file mode 100644 index 0000000..7394af8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_base_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The action to be taken on the image. Can be either `convert` or `transfer`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Image_action_base_type + { + [EnumMember(Value = "convert")] + #pragma warning disable CS1591 + Convert, + #pragma warning restore CS1591 + [EnumMember(Value = "transfer")] + #pragma warning disable CS1591 + Transfer, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_transfer.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_transfer.cs new file mode 100644 index 0000000..59f515f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image_action_transfer.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Image_action_transfer : global::InfinityFlow.DigitalOcean.Client.Models.Image_action_base, IParsable + #pragma warning restore CS1591 + { + /// The slug identifier for the region where the resource will initially be available. + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? Region { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Image_action_transfer CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Image_action_transfer(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "region", n => { Region = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("region", Region); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image_new_custom.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image_new_custom.cs new file mode 100644 index 0000000..85398aa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image_new_custom.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Image_new_custom : global::InfinityFlow.DigitalOcean.Client.Models.Image_update, IParsable + #pragma warning restore CS1591 + { + /// The slug identifier for the region where the resource will initially be available. + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? Region { get; set; } + /// A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// A URL from which the custom Linux virtual machine image may be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or vmdk format. It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "region", n => { Region = n.GetEnumValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("region", Region); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteStringValue("url", Url); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image_status.cs new file mode 100644 index 0000000..8607ff4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image_status.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A status string indicating the state of a custom image. This may be `NEW`, `available`, `pending`, `deleted`, or `retired`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Image_status + { + [EnumMember(Value = "NEW")] + #pragma warning disable CS1591 + NEW, + #pragma warning restore CS1591 + [EnumMember(Value = "available")] + #pragma warning disable CS1591 + Available, + #pragma warning restore CS1591 + [EnumMember(Value = "pending")] + #pragma warning disable CS1591 + Pending, + #pragma warning restore CS1591 + [EnumMember(Value = "deleted")] + #pragma warning disable CS1591 + Deleted, + #pragma warning restore CS1591 + [EnumMember(Value = "retired")] + #pragma warning disable CS1591 + Retired, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image_type.cs new file mode 100644 index 0000000..db409e3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image_type.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes). + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Image_type + { + [EnumMember(Value = "base")] + #pragma warning disable CS1591 + Base, + #pragma warning restore CS1591 + [EnumMember(Value = "snapshot")] + #pragma warning disable CS1591 + Snapshot, + #pragma warning restore CS1591 + [EnumMember(Value = "backup")] + #pragma warning disable CS1591 + Backup, + #pragma warning restore CS1591 + [EnumMember(Value = "custom")] + #pragma warning disable CS1591 + Custom, + #pragma warning restore CS1591 + [EnumMember(Value = "admin")] + #pragma warning disable CS1591 + Admin, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Image_update.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Image_update.cs new file mode 100644 index 0000000..155148e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Image_update.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Image_update : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An optional free-form text field to describe an image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place. + public global::InfinityFlow.DigitalOcean.Client.Models.Distribution? Distribution { get; set; } + /// The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Image_update() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Image_update CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Image_update(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "description", n => { Description = n.GetStringValue(); } }, + { "distribution", n => { Distribution = n.GetEnumValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteEnumValue("distribution", Distribution); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Instance_size_cpu_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Instance_size_cpu_type.cs new file mode 100644 index 0000000..df6f75d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Instance_size_cpu_type.cs @@ -0,0 +1,24 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Instance_size_cpu_type + #pragma warning restore CS1591 + { + [EnumMember(Value = "UNSPECIFIED")] + #pragma warning disable CS1591 + UNSPECIFIED, + #pragma warning restore CS1591 + [EnumMember(Value = "SHARED")] + #pragma warning disable CS1591 + SHARED, + #pragma warning restore CS1591 + [EnumMember(Value = "DEDICATED")] + #pragma warning disable CS1591 + DEDICATED, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_item.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_item.cs new file mode 100644 index 0000000..d925dca --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_item.cs @@ -0,0 +1,165 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Invoice_item : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Billed amount of this invoice item. Billed in USD. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Amount { get; set; } +#nullable restore +#else + public string Amount { get; set; } +#endif + /// Description of the invoice item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// Duration of time this invoice item was used and subsequently billed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Duration { get; set; } +#nullable restore +#else + public string Duration { get; set; } +#endif + /// Unit of time for duration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DurationUnit { get; set; } +#nullable restore +#else + public string DurationUnit { get; set; } +#endif + /// Time the invoice item stopped being billed for usage. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EndTime { get; set; } +#nullable restore +#else + public string EndTime { get; set; } +#endif + /// Description of the invoice item when it is a grouped set of usage, such as DOKS or databases. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? GroupDescription { get; set; } +#nullable restore +#else + public string GroupDescription { get; set; } +#endif + /// Name of the product being billed in the invoice item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Product { get; set; } +#nullable restore +#else + public string Product { get; set; } +#endif + /// Name of the DigitalOcean Project this resource belongs to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProjectName { get; set; } +#nullable restore +#else + public string ProjectName { get; set; } +#endif + /// ID of the resource billing in the invoice item if available. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ResourceId { get; set; } +#nullable restore +#else + public string ResourceId { get; set; } +#endif + /// UUID of the resource billing in the invoice item if available. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ResourceUuid { get; set; } +#nullable restore +#else + public string ResourceUuid { get; set; } +#endif + /// Time the invoice item began to be billed for usage. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? StartTime { get; set; } +#nullable restore +#else + public string StartTime { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Invoice_item() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Invoice_item CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Invoice_item(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetStringValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "duration", n => { Duration = n.GetStringValue(); } }, + { "duration_unit", n => { DurationUnit = n.GetStringValue(); } }, + { "end_time", n => { EndTime = n.GetStringValue(); } }, + { "group_description", n => { GroupDescription = n.GetStringValue(); } }, + { "product", n => { Product = n.GetStringValue(); } }, + { "project_name", n => { ProjectName = n.GetStringValue(); } }, + { "resource_id", n => { ResourceId = n.GetStringValue(); } }, + { "resource_uuid", n => { ResourceUuid = n.GetStringValue(); } }, + { "start_time", n => { StartTime = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("amount", Amount); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("duration", Duration); + writer.WriteStringValue("duration_unit", DurationUnit); + writer.WriteStringValue("end_time", EndTime); + writer.WriteStringValue("group_description", GroupDescription); + writer.WriteStringValue("product", Product); + writer.WriteStringValue("project_name", ProjectName); + writer.WriteStringValue("resource_id", ResourceId); + writer.WriteStringValue("resource_uuid", ResourceUuid); + writer.WriteStringValue("start_time", StartTime); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_preview.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_preview.cs new file mode 100644 index 0000000..3163cb8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_preview.cs @@ -0,0 +1,106 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The invoice preview. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Invoice_preview : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Total amount of the invoice, in USD. This will reflect month-to-date usage in the invoice preview. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Amount { get; set; } +#nullable restore +#else + public string Amount { get; set; } +#endif + /// ID of the invoice. Listed on the face of the invoice PDF as the "Invoice number". +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InvoiceId { get; set; } +#nullable restore +#else + public string InvoiceId { get; set; } +#endif + /// Billing period of usage for which the invoice is issued, in `YYYY-MM` format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InvoicePeriod { get; set; } +#nullable restore +#else + public string InvoicePeriod { get; set; } +#endif + /// The UUID of the invoice. The canonical reference for the invoice. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InvoiceUuid { get; set; } +#nullable restore +#else + public string InvoiceUuid { get; set; } +#endif + /// Time the invoice was last updated. This is only included with the invoice preview. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UpdatedAt { get; set; } +#nullable restore +#else + public string UpdatedAt { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Invoice_preview() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Invoice_preview CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Invoice_preview(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetStringValue(); } }, + { "invoice_id", n => { InvoiceId = n.GetStringValue(); } }, + { "invoice_period", n => { InvoicePeriod = n.GetStringValue(); } }, + { "invoice_uuid", n => { InvoiceUuid = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("amount", Amount); + writer.WriteStringValue("invoice_id", InvoiceId); + writer.WriteStringValue("invoice_period", InvoicePeriod); + writer.WriteStringValue("invoice_uuid", InvoiceUuid); + writer.WriteStringValue("updated_at", UpdatedAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_summary.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_summary.cs new file mode 100644 index 0000000..865f44c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Invoice_summary.cs @@ -0,0 +1,175 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Invoice_summary : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Total amount of the invoice, in USD. This will reflect month-to-date usage in the invoice preview. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Amount { get; set; } +#nullable restore +#else + public string Amount { get; set; } +#endif + /// Billing period of usage for which the invoice is issued, in `YYYY-MM` format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BillingPeriod { get; set; } +#nullable restore +#else + public string BillingPeriod { get; set; } +#endif + /// The credits_and_adjustments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge? CreditsAndAdjustments { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge CreditsAndAdjustments { get; set; } +#endif + /// ID of the invoice +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InvoiceId { get; set; } +#nullable restore +#else + public string InvoiceId { get; set; } +#endif + /// UUID of the invoice +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InvoiceUuid { get; set; } +#nullable restore +#else + public string InvoiceUuid { get; set; } +#endif + /// The overages property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge? Overages { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge Overages { get; set; } +#endif + /// The product_charges property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Product_usage_charges? ProductCharges { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Product_usage_charges ProductCharges { get; set; } +#endif + /// The taxes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge? Taxes { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge Taxes { get; set; } +#endif + /// The user_billing_address property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Billing_address? UserBillingAddress { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Billing_address UserBillingAddress { get; set; } +#endif + /// Company of the DigitalOcean customer being invoiced, if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserCompany { get; set; } +#nullable restore +#else + public string UserCompany { get; set; } +#endif + /// Email of the DigitalOcean customer being invoiced. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserEmail { get; set; } +#nullable restore +#else + public string UserEmail { get; set; } +#endif + /// Name of the DigitalOcean customer being invoiced. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserName { get; set; } +#nullable restore +#else + public string UserName { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Invoice_summary() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Invoice_summary CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Invoice_summary(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetStringValue(); } }, + { "billing_period", n => { BillingPeriod = n.GetStringValue(); } }, + { "credits_and_adjustments", n => { CreditsAndAdjustments = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge.CreateFromDiscriminatorValue); } }, + { "invoice_id", n => { InvoiceId = n.GetStringValue(); } }, + { "invoice_uuid", n => { InvoiceUuid = n.GetStringValue(); } }, + { "overages", n => { Overages = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge.CreateFromDiscriminatorValue); } }, + { "product_charges", n => { ProductCharges = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Product_usage_charges.CreateFromDiscriminatorValue); } }, + { "taxes", n => { Taxes = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge.CreateFromDiscriminatorValue); } }, + { "user_billing_address", n => { UserBillingAddress = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Billing_address.CreateFromDiscriminatorValue); } }, + { "user_company", n => { UserCompany = n.GetStringValue(); } }, + { "user_email", n => { UserEmail = n.GetStringValue(); } }, + { "user_name", n => { UserName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("amount", Amount); + writer.WriteStringValue("billing_period", BillingPeriod); + writer.WriteObjectValue("credits_and_adjustments", CreditsAndAdjustments); + writer.WriteStringValue("invoice_id", InvoiceId); + writer.WriteStringValue("invoice_uuid", InvoiceUuid); + writer.WriteObjectValue("overages", Overages); + writer.WriteObjectValue("product_charges", ProductCharges); + writer.WriteObjectValue("taxes", Taxes); + writer.WriteObjectValue("user_billing_address", UserBillingAddress); + writer.WriteStringValue("user_company", UserCompany); + writer.WriteStringValue("user_email", UserEmail); + writer.WriteStringValue("user_name", UserName); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config.cs new file mode 100644 index 0000000..c10b7ee --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config.cs @@ -0,0 +1,211 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_advanced_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Enable auto creation of topics + public bool? AutoCreateTopicsEnable { get; set; } + /// Specify the final compression type for a given topic. This configuration accepts the standard compression codecs ('gzip', 'snappy', 'lz4', 'zstd'). It additionally accepts 'uncompressed' which is equivalent to no compression; and 'producer' which means retain the original compression codec set by the producer. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config_compression_type? CompressionType { get; set; } + /// Idle connections timeout: the server socket processor threads close the connections that idle for longer than this. + public int? ConnectionsMaxIdleMs { get; set; } + /// Replication factor for autocreated topics + public int? DefaultReplicationFactor { get; set; } + /// The amount of time, in milliseconds, the group coordinator will wait for more consumers to join a new group before performing the first rebalance. A longer delay means potentially fewer rebalances, but increases the time until processing begins. The default value for this is 3 seconds. During development and testing it might be desirable to set this to 0 in order to not delay test execution time. + public int? GroupInitialRebalanceDelayMs { get; set; } + /// The maximum allowed session timeout for registered consumers. Longer timeouts give consumers more time to process messages in between heartbeats at the cost of a longer time to detect failures. + public int? GroupMaxSessionTimeoutMs { get; set; } + /// The minimum allowed session timeout for registered consumers. Longer timeouts give consumers more time to process messages in between heartbeats at the cost of a longer time to detect failures. + public int? GroupMinSessionTimeoutMs { get; set; } + /// How long are delete records retained? + public int? LogCleanerDeleteRetentionMs { get; set; } + /// The maximum amount of time message will remain uncompacted. Only applicable for logs that are being compacted + public int? LogCleanerMaxCompactionLagMs { get; set; } + /// Controls log compactor frequency. Larger value means more frequent compactions but also more space wasted for logs. Consider setting log_cleaner_max_compaction_lag_ms to enforce compactions sooner, instead of setting a very high value for this option. + public double? LogCleanerMinCleanableRatio { get; set; } + /// The minimum time a message will remain uncompacted in the log. Only applicable for logs that are being compacted. + public int? LogCleanerMinCompactionLagMs { get; set; } + /// The default cleanup policy for segments beyond the retention window + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config_log_cleanup_policy? LogCleanupPolicy { get; set; } + /// The number of messages accumulated on a log partition before messages are flushed to disk + public int? LogFlushIntervalMessages { get; set; } + /// The maximum time in ms that a message in any topic is kept in memory before flushed to disk. If not set, the value in log.flush.scheduler.interval.ms is used + public int? LogFlushIntervalMs { get; set; } + /// The interval with which Kafka adds an entry to the offset index + public int? LogIndexIntervalBytes { get; set; } + /// The maximum size in bytes of the offset index + public int? LogIndexSizeMaxBytes { get; set; } + /// This configuration controls whether down-conversion of message formats is enabled to satisfy consume requests. + public bool? LogMessageDownconversionEnable { get; set; } + /// The maximum difference allowed between the timestamp when a broker receives a message and the timestamp specified in the message + public int? LogMessageTimestampDifferenceMaxMs { get; set; } + /// Define whether the timestamp in the message is message create time or log append time. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config_log_message_timestamp_type? LogMessageTimestampType { get; set; } + /// Controls whether to preallocate a file when creating a new segment + public bool? LogPreallocate { get; set; } + /// The maximum size of the log before deleting messages + public int? LogRetentionBytes { get; set; } + /// The number of hours to keep a log file before deleting it + public int? LogRetentionHours { get; set; } + /// The number of milliseconds to keep a log file before deleting it (in milliseconds), If not set, the value in log.retention.minutes is used. If set to -1, no time limit is applied. + public int? LogRetentionMs { get; set; } + /// The maximum jitter to subtract from logRollTimeMillis (in milliseconds). If not set, the value in log.roll.jitter.hours is used + public int? LogRollJitterMs { get; set; } + /// The maximum time before a new log segment is rolled out (in milliseconds). + public int? LogRollMs { get; set; } + /// The maximum size of a single log file + public int? LogSegmentBytes { get; set; } + /// The amount of time to wait before deleting a file from the filesystem + public int? LogSegmentDeleteDelayMs { get; set; } + /// The maximum number of connections allowed from each ip address (defaults to 2147483647). + public int? MaxConnectionsPerIp { get; set; } + /// The maximum number of incremental fetch sessions that the broker will maintain. + public int? MaxIncrementalFetchSessionCacheSlots { get; set; } + /// The maximum size of message that the server can receive. + public int? MessageMaxBytes { get; set; } + /// When a producer sets acks to 'all' (or '-1'), min_insync_replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. + public int? MinInsyncReplicas { get; set; } + /// Number of partitions for autocreated topics + public int? NumPartitions { get; set; } + /// Log retention window in minutes for offsets topic + public int? OffsetsRetentionMinutes { get; set; } + /// The purge interval (in number of requests) of the producer request purgatory (defaults to 1000). + public int? ProducerPurgatoryPurgeIntervalRequests { get; set; } + /// The number of bytes of messages to attempt to fetch for each partition (defaults to 1048576). This is not an absolute maximum, if the first record batch in the first non-empty partition of the fetch is larger than this value, the record batch will still be returned to ensure that progress can be made. + public int? ReplicaFetchMaxBytes { get; set; } + /// Maximum bytes expected for the entire fetch response (defaults to 10485760). Records are fetched in batches, and if the first record batch in the first non-empty partition of the fetch is larger than this value, the record batch will still be returned to ensure that progress can be made. As such, this is not an absolute maximum. + public int? ReplicaFetchResponseMaxBytes { get; set; } + /// The maximum number of bytes in a socket request (defaults to 104857600). + public int? SocketRequestMaxBytes { get; set; } + /// The interval at which to remove transactions that have expired due to transactional.id.expiration.ms passing (defaults to 3600000 (1 hour)). + public int? TransactionRemoveExpiredTransactionCleanupIntervalMs { get; set; } + /// The transaction topic segment bytes should be kept relatively small in order to facilitate faster log compaction and cache loads (defaults to 104857600 (100 mebibytes)). + public int? TransactionStateLogSegmentBytes { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kafka_advanced_config() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auto_create_topics_enable", n => { AutoCreateTopicsEnable = n.GetBoolValue(); } }, + { "compression_type", n => { CompressionType = n.GetEnumValue(); } }, + { "connections_max_idle_ms", n => { ConnectionsMaxIdleMs = n.GetIntValue(); } }, + { "default_replication_factor", n => { DefaultReplicationFactor = n.GetIntValue(); } }, + { "group_initial_rebalance_delay_ms", n => { GroupInitialRebalanceDelayMs = n.GetIntValue(); } }, + { "group_max_session_timeout_ms", n => { GroupMaxSessionTimeoutMs = n.GetIntValue(); } }, + { "group_min_session_timeout_ms", n => { GroupMinSessionTimeoutMs = n.GetIntValue(); } }, + { "log_cleaner_delete_retention_ms", n => { LogCleanerDeleteRetentionMs = n.GetIntValue(); } }, + { "log_cleaner_max_compaction_lag_ms", n => { LogCleanerMaxCompactionLagMs = n.GetIntValue(); } }, + { "log_cleaner_min_cleanable_ratio", n => { LogCleanerMinCleanableRatio = n.GetDoubleValue(); } }, + { "log_cleaner_min_compaction_lag_ms", n => { LogCleanerMinCompactionLagMs = n.GetIntValue(); } }, + { "log_cleanup_policy", n => { LogCleanupPolicy = n.GetEnumValue(); } }, + { "log_flush_interval_messages", n => { LogFlushIntervalMessages = n.GetIntValue(); } }, + { "log_flush_interval_ms", n => { LogFlushIntervalMs = n.GetIntValue(); } }, + { "log_index_interval_bytes", n => { LogIndexIntervalBytes = n.GetIntValue(); } }, + { "log_index_size_max_bytes", n => { LogIndexSizeMaxBytes = n.GetIntValue(); } }, + { "log_message_downconversion_enable", n => { LogMessageDownconversionEnable = n.GetBoolValue(); } }, + { "log_message_timestamp_difference_max_ms", n => { LogMessageTimestampDifferenceMaxMs = n.GetIntValue(); } }, + { "log_message_timestamp_type", n => { LogMessageTimestampType = n.GetEnumValue(); } }, + { "log_preallocate", n => { LogPreallocate = n.GetBoolValue(); } }, + { "log_retention_bytes", n => { LogRetentionBytes = n.GetIntValue(); } }, + { "log_retention_hours", n => { LogRetentionHours = n.GetIntValue(); } }, + { "log_retention_ms", n => { LogRetentionMs = n.GetIntValue(); } }, + { "log_roll_jitter_ms", n => { LogRollJitterMs = n.GetIntValue(); } }, + { "log_roll_ms", n => { LogRollMs = n.GetIntValue(); } }, + { "log_segment_bytes", n => { LogSegmentBytes = n.GetIntValue(); } }, + { "log_segment_delete_delay_ms", n => { LogSegmentDeleteDelayMs = n.GetIntValue(); } }, + { "max_connections_per_ip", n => { MaxConnectionsPerIp = n.GetIntValue(); } }, + { "max_incremental_fetch_session_cache_slots", n => { MaxIncrementalFetchSessionCacheSlots = n.GetIntValue(); } }, + { "message_max_bytes", n => { MessageMaxBytes = n.GetIntValue(); } }, + { "min_insync_replicas", n => { MinInsyncReplicas = n.GetIntValue(); } }, + { "num_partitions", n => { NumPartitions = n.GetIntValue(); } }, + { "offsets_retention_minutes", n => { OffsetsRetentionMinutes = n.GetIntValue(); } }, + { "producer_purgatory_purge_interval_requests", n => { ProducerPurgatoryPurgeIntervalRequests = n.GetIntValue(); } }, + { "replica_fetch_max_bytes", n => { ReplicaFetchMaxBytes = n.GetIntValue(); } }, + { "replica_fetch_response_max_bytes", n => { ReplicaFetchResponseMaxBytes = n.GetIntValue(); } }, + { "socket_request_max_bytes", n => { SocketRequestMaxBytes = n.GetIntValue(); } }, + { "transaction_remove_expired_transaction_cleanup_interval_ms", n => { TransactionRemoveExpiredTransactionCleanupIntervalMs = n.GetIntValue(); } }, + { "transaction_state_log_segment_bytes", n => { TransactionStateLogSegmentBytes = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("auto_create_topics_enable", AutoCreateTopicsEnable); + writer.WriteEnumValue("compression_type", CompressionType); + writer.WriteIntValue("connections_max_idle_ms", ConnectionsMaxIdleMs); + writer.WriteIntValue("default_replication_factor", DefaultReplicationFactor); + writer.WriteIntValue("group_initial_rebalance_delay_ms", GroupInitialRebalanceDelayMs); + writer.WriteIntValue("group_max_session_timeout_ms", GroupMaxSessionTimeoutMs); + writer.WriteIntValue("group_min_session_timeout_ms", GroupMinSessionTimeoutMs); + writer.WriteIntValue("log_cleaner_delete_retention_ms", LogCleanerDeleteRetentionMs); + writer.WriteIntValue("log_cleaner_max_compaction_lag_ms", LogCleanerMaxCompactionLagMs); + writer.WriteDoubleValue("log_cleaner_min_cleanable_ratio", LogCleanerMinCleanableRatio); + writer.WriteIntValue("log_cleaner_min_compaction_lag_ms", LogCleanerMinCompactionLagMs); + writer.WriteEnumValue("log_cleanup_policy", LogCleanupPolicy); + writer.WriteIntValue("log_flush_interval_messages", LogFlushIntervalMessages); + writer.WriteIntValue("log_flush_interval_ms", LogFlushIntervalMs); + writer.WriteIntValue("log_index_interval_bytes", LogIndexIntervalBytes); + writer.WriteIntValue("log_index_size_max_bytes", LogIndexSizeMaxBytes); + writer.WriteBoolValue("log_message_downconversion_enable", LogMessageDownconversionEnable); + writer.WriteIntValue("log_message_timestamp_difference_max_ms", LogMessageTimestampDifferenceMaxMs); + writer.WriteEnumValue("log_message_timestamp_type", LogMessageTimestampType); + writer.WriteBoolValue("log_preallocate", LogPreallocate); + writer.WriteIntValue("log_retention_bytes", LogRetentionBytes); + writer.WriteIntValue("log_retention_hours", LogRetentionHours); + writer.WriteIntValue("log_retention_ms", LogRetentionMs); + writer.WriteIntValue("log_roll_jitter_ms", LogRollJitterMs); + writer.WriteIntValue("log_roll_ms", LogRollMs); + writer.WriteIntValue("log_segment_bytes", LogSegmentBytes); + writer.WriteIntValue("log_segment_delete_delay_ms", LogSegmentDeleteDelayMs); + writer.WriteIntValue("max_connections_per_ip", MaxConnectionsPerIp); + writer.WriteIntValue("max_incremental_fetch_session_cache_slots", MaxIncrementalFetchSessionCacheSlots); + writer.WriteIntValue("message_max_bytes", MessageMaxBytes); + writer.WriteIntValue("min_insync_replicas", MinInsyncReplicas); + writer.WriteIntValue("num_partitions", NumPartitions); + writer.WriteIntValue("offsets_retention_minutes", OffsetsRetentionMinutes); + writer.WriteIntValue("producer_purgatory_purge_interval_requests", ProducerPurgatoryPurgeIntervalRequests); + writer.WriteIntValue("replica_fetch_max_bytes", ReplicaFetchMaxBytes); + writer.WriteIntValue("replica_fetch_response_max_bytes", ReplicaFetchResponseMaxBytes); + writer.WriteIntValue("socket_request_max_bytes", SocketRequestMaxBytes); + writer.WriteIntValue("transaction_remove_expired_transaction_cleanup_interval_ms", TransactionRemoveExpiredTransactionCleanupIntervalMs); + writer.WriteIntValue("transaction_state_log_segment_bytes", TransactionStateLogSegmentBytes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_compression_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_compression_type.cs new file mode 100644 index 0000000..73671a9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_compression_type.cs @@ -0,0 +1,35 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Specify the final compression type for a given topic. This configuration accepts the standard compression codecs ('gzip', 'snappy', 'lz4', 'zstd'). It additionally accepts 'uncompressed' which is equivalent to no compression; and 'producer' which means retain the original compression codec set by the producer. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_advanced_config_compression_type + { + [EnumMember(Value = "gzip")] + #pragma warning disable CS1591 + Gzip, + #pragma warning restore CS1591 + [EnumMember(Value = "snappy")] + #pragma warning disable CS1591 + Snappy, + #pragma warning restore CS1591 + [EnumMember(Value = "lz4")] + #pragma warning disable CS1591 + Lz4, + #pragma warning restore CS1591 + [EnumMember(Value = "zstd")] + #pragma warning disable CS1591 + Zstd, + #pragma warning restore CS1591 + [EnumMember(Value = "uncompressed")] + #pragma warning disable CS1591 + Uncompressed, + #pragma warning restore CS1591 + [EnumMember(Value = "producer")] + #pragma warning disable CS1591 + Producer, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_log_cleanup_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_log_cleanup_policy.cs new file mode 100644 index 0000000..6188cfa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_log_cleanup_policy.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The default cleanup policy for segments beyond the retention window + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_advanced_config_log_cleanup_policy + { + [EnumMember(Value = "delete")] + #pragma warning disable CS1591 + Delete, + #pragma warning restore CS1591 + [EnumMember(Value = "compact")] + #pragma warning disable CS1591 + Compact, + #pragma warning restore CS1591 + [EnumMember(Value = "compact,delete")] + #pragma warning disable CS1591 + CompactDelete, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_log_message_timestamp_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_log_message_timestamp_type.cs new file mode 100644 index 0000000..f360b37 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_advanced_config_log_message_timestamp_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Define whether the timestamp in the message is message create time or log append time. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_advanced_config_log_message_timestamp_type + { + [EnumMember(Value = "CreateTime")] + #pragma warning disable CS1591 + CreateTime, + #pragma warning restore CS1591 + [EnumMember(Value = "LogAppendTime")] + #pragma warning disable CS1591 + LogAppendTime, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic.cs new file mode 100644 index 0000000..2c6de2d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic : global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_base, IParsable + #pragma warning restore CS1591 + { + /// The state of the Kafka topic. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_state? State { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "state", n => { State = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("state", State); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_base.cs new file mode 100644 index 0000000..2d85e4e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_base.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the Kafka topic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The number of partitions available for the topic. On update, this value can only be increased. + public int? PartitionCount { get; set; } + /// The number of nodes to replicate data across the cluster. + public int? ReplicationFactor { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kafka_topic_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "partition_count", n => { PartitionCount = n.GetIntValue(); } }, + { "replication_factor", n => { ReplicationFactor = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteIntValue("partition_count", PartitionCount); + writer.WriteIntValue("replication_factor", ReplicationFactor); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config.cs new file mode 100644 index 0000000..2f00dd7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config.cs @@ -0,0 +1,146 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cleanup_policy sets the retention policy to use on log segments. 'delete' will discard old segments when retention time/size limits are reached. 'compact' will enable log compaction, resulting in retention of the latest value for each key. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_cleanup_policy? CleanupPolicy { get; set; } + /// The compression_type specifies the compression type of the topic. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_compression_type? CompressionType { get; set; } + /// The delete_retention_ms specifies how long (in ms) to retain delete tombstone markers for topics. + public int? DeleteRetentionMs { get; set; } + /// The file_delete_delay_ms specifies the time (in ms) to wait before deleting a file from the filesystem. + public int? FileDeleteDelayMs { get; set; } + /// The flush_messages specifies the number of messages to accumulate on a log partition before messages are flushed to disk. + public int? FlushMessages { get; set; } + /// The flush_ms specifies the maximum time (in ms) that a message is kept in memory before being flushed to disk. + public int? FlushMs { get; set; } + /// The index_interval_bytes specifies the number of bytes between entries being added into te offset index. + public int? IndexIntervalBytes { get; set; } + /// The max_compaction_lag_ms specifies the maximum amount of time (in ms) that a message will remain uncompacted. This is only applicable if the logs are have compaction enabled. + public int? MaxCompactionLagMs { get; set; } + /// The max_messages_bytes specifies the largest record batch size (in bytes) that can be sent to the server. This is calculated after compression if compression is enabled. + public int? MaxMessageBytes { get; set; } + /// The message_down_conversion_enable specifies whether down-conversion of message formats is enabled to satisfy consumer requests. When 'false', the broker will not perform conversion for consumers expecting older message formats. The broker will respond with an `UNSUPPORTED_VERSION` error for consume requests from these older clients. + public bool? MessageDownConversionEnable { get; set; } + /// The message_format_version specifies the message format version used by the broker to append messages to the logs. The value of this setting is assumed to be 3.0-IV1 if the broker protocol version is 3.0 or higher. By setting a particular message format version, all existing messages on disk must be smaller or equal to the specified version. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_message_format_version? MessageFormatVersion { get; set; } + /// The message_timestamp_type specifies whether to use the message create time or log append time as the timestamp on a message. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_message_timestamp_type? MessageTimestampType { get; set; } + /// The min_cleanable_dirty_ratio specifies the frequency of log compaction (if enabled) in relation to duplicates present in the logs. For example, at 0.5, at most 50% of the log could be duplicates before compaction would begin. + public float? MinCleanableDirtyRatio { get; set; } + /// The min_compaction_lag_ms specifies the minimum time (in ms) that a message will remain uncompacted in the log. Only relevant if log compaction is enabled. + public int? MinCompactionLagMs { get; set; } + /// The min_insync_replicas specifies the number of replicas that must ACK a write for the write to be considered successful. + public int? MinInsyncReplicas { get; set; } + /// The preallocate specifies whether a file should be preallocated on disk when creating a new log segment. + public bool? Preallocate { get; set; } + /// The retention_bytes specifies the maximum size of the log (in bytes) before deleting messages. -1 indicates that there is no limit. + public int? RetentionBytes { get; set; } + /// The retention_ms specifies the maximum amount of time (in ms) to keep a message before deleting it. + public int? RetentionMs { get; set; } + /// The segment_bytes specifies the maximum size of a single log file (in bytes). + public int? SegmentBytes { get; set; } + /// The segment_jitter_ms specifies the maximum random jitter subtracted from the scheduled segment roll time to avoid thundering herds of segment rolling. + public int? SegmentJitterMs { get; set; } + /// The segment_ms specifies the period of time after which the log will be forced to roll if the segment file isn't full. This ensures that retention can delete or compact old data. + public int? SegmentMs { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kafka_topic_config() + { + AdditionalData = new Dictionary(); + CleanupPolicy = global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_cleanup_policy.Delete; + CompressionType = global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_compression_type.Producer; + FlushMessages = 9223372; + FlushMs = 9223372; + MaxCompactionLagMs = 9223372; + MessageFormatVersion = global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_message_format_version.ThreeZeroIV1; + MessageTimestampType = global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config_message_timestamp_type.Create_time; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cleanup_policy", n => { CleanupPolicy = n.GetEnumValue(); } }, + { "compression_type", n => { CompressionType = n.GetEnumValue(); } }, + { "delete_retention_ms", n => { DeleteRetentionMs = n.GetIntValue(); } }, + { "file_delete_delay_ms", n => { FileDeleteDelayMs = n.GetIntValue(); } }, + { "flush_messages", n => { FlushMessages = n.GetIntValue(); } }, + { "flush_ms", n => { FlushMs = n.GetIntValue(); } }, + { "index_interval_bytes", n => { IndexIntervalBytes = n.GetIntValue(); } }, + { "max_compaction_lag_ms", n => { MaxCompactionLagMs = n.GetIntValue(); } }, + { "max_message_bytes", n => { MaxMessageBytes = n.GetIntValue(); } }, + { "message_down_conversion_enable", n => { MessageDownConversionEnable = n.GetBoolValue(); } }, + { "message_format_version", n => { MessageFormatVersion = n.GetEnumValue(); } }, + { "message_timestamp_type", n => { MessageTimestampType = n.GetEnumValue(); } }, + { "min_cleanable_dirty_ratio", n => { MinCleanableDirtyRatio = n.GetFloatValue(); } }, + { "min_compaction_lag_ms", n => { MinCompactionLagMs = n.GetIntValue(); } }, + { "min_insync_replicas", n => { MinInsyncReplicas = n.GetIntValue(); } }, + { "preallocate", n => { Preallocate = n.GetBoolValue(); } }, + { "retention_bytes", n => { RetentionBytes = n.GetIntValue(); } }, + { "retention_ms", n => { RetentionMs = n.GetIntValue(); } }, + { "segment_bytes", n => { SegmentBytes = n.GetIntValue(); } }, + { "segment_jitter_ms", n => { SegmentJitterMs = n.GetIntValue(); } }, + { "segment_ms", n => { SegmentMs = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("cleanup_policy", CleanupPolicy); + writer.WriteEnumValue("compression_type", CompressionType); + writer.WriteIntValue("delete_retention_ms", DeleteRetentionMs); + writer.WriteIntValue("file_delete_delay_ms", FileDeleteDelayMs); + writer.WriteIntValue("flush_messages", FlushMessages); + writer.WriteIntValue("flush_ms", FlushMs); + writer.WriteIntValue("index_interval_bytes", IndexIntervalBytes); + writer.WriteIntValue("max_compaction_lag_ms", MaxCompactionLagMs); + writer.WriteIntValue("max_message_bytes", MaxMessageBytes); + writer.WriteBoolValue("message_down_conversion_enable", MessageDownConversionEnable); + writer.WriteEnumValue("message_format_version", MessageFormatVersion); + writer.WriteEnumValue("message_timestamp_type", MessageTimestampType); + writer.WriteFloatValue("min_cleanable_dirty_ratio", MinCleanableDirtyRatio); + writer.WriteIntValue("min_compaction_lag_ms", MinCompactionLagMs); + writer.WriteIntValue("min_insync_replicas", MinInsyncReplicas); + writer.WriteBoolValue("preallocate", Preallocate); + writer.WriteIntValue("retention_bytes", RetentionBytes); + writer.WriteIntValue("retention_ms", RetentionMs); + writer.WriteIntValue("segment_bytes", SegmentBytes); + writer.WriteIntValue("segment_jitter_ms", SegmentJitterMs); + writer.WriteIntValue("segment_ms", SegmentMs); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_cleanup_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_cleanup_policy.cs new file mode 100644 index 0000000..e79a585 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_cleanup_policy.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The cleanup_policy sets the retention policy to use on log segments. 'delete' will discard old segments when retention time/size limits are reached. 'compact' will enable log compaction, resulting in retention of the latest value for each key. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_topic_config_cleanup_policy + { + [EnumMember(Value = "delete")] + #pragma warning disable CS1591 + Delete, + #pragma warning restore CS1591 + [EnumMember(Value = "compact")] + #pragma warning disable CS1591 + Compact, + #pragma warning restore CS1591 + [EnumMember(Value = "compact_delete")] + #pragma warning disable CS1591 + Compact_delete, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_compression_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_compression_type.cs new file mode 100644 index 0000000..ecd996a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_compression_type.cs @@ -0,0 +1,35 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The compression_type specifies the compression type of the topic. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_topic_config_compression_type + { + [EnumMember(Value = "producer")] + #pragma warning disable CS1591 + Producer, + #pragma warning restore CS1591 + [EnumMember(Value = "gzip")] + #pragma warning disable CS1591 + Gzip, + #pragma warning restore CS1591 + [EnumMember(Value = "snappy")] + #pragma warning disable CS1591 + Snappy, + #pragma warning restore CS1591 + [EnumMember(Value = "Iz4")] + #pragma warning disable CS1591 + Iz4, + #pragma warning restore CS1591 + [EnumMember(Value = "zstd")] + #pragma warning disable CS1591 + Zstd, + #pragma warning restore CS1591 + [EnumMember(Value = "uncompressed")] + #pragma warning disable CS1591 + Uncompressed, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_message_format_version.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_message_format_version.cs new file mode 100644 index 0000000..724dacb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_message_format_version.cs @@ -0,0 +1,175 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The message_format_version specifies the message format version used by the broker to append messages to the logs. The value of this setting is assumed to be 3.0-IV1 if the broker protocol version is 3.0 or higher. By setting a particular message format version, all existing messages on disk must be smaller or equal to the specified version. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_topic_config_message_format_version + { + [EnumMember(Value = "0.8.0")] + #pragma warning disable CS1591 + ZeroEightZero, + #pragma warning restore CS1591 + [EnumMember(Value = "0.8.1")] + #pragma warning disable CS1591 + ZeroEightOne, + #pragma warning restore CS1591 + [EnumMember(Value = "0.8.2")] + #pragma warning disable CS1591 + ZeroEightTwo, + #pragma warning restore CS1591 + [EnumMember(Value = "0.9.0")] + #pragma warning disable CS1591 + ZeroNineZero, + #pragma warning restore CS1591 + [EnumMember(Value = "0.10.0-IV0")] + #pragma warning disable CS1591 + ZeroOneZeroZeroIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "0.10.0-IV1")] + #pragma warning disable CS1591 + ZeroOneZeroZeroIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "0.10.1-IV0")] + #pragma warning disable CS1591 + ZeroOneZeroOneIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "0.10.1-IV1")] + #pragma warning disable CS1591 + ZeroOneZeroOneIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "0.10.1-IV2")] + #pragma warning disable CS1591 + ZeroOneZeroOneIV2, + #pragma warning restore CS1591 + [EnumMember(Value = "0.10.2-IV0")] + #pragma warning disable CS1591 + ZeroOneZeroTwoIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "0.11.0-IV0")] + #pragma warning disable CS1591 + ZeroOneOneZeroIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "0.11.0-IV1")] + #pragma warning disable CS1591 + ZeroOneOneZeroIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "0.11.0-IV2")] + #pragma warning disable CS1591 + ZeroOneOneZeroIV2, + #pragma warning restore CS1591 + [EnumMember(Value = "1.0-IV0")] + #pragma warning disable CS1591 + OneZeroIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "1.1-IV0")] + #pragma warning disable CS1591 + OneOneIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.0-IV0")] + #pragma warning disable CS1591 + TwoZeroIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.0-IV1")] + #pragma warning disable CS1591 + TwoZeroIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "2.1-IV0")] + #pragma warning disable CS1591 + TwoOneIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.1-IV1")] + #pragma warning disable CS1591 + TwoOneIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "2.1-IV2")] + #pragma warning disable CS1591 + TwoOneIV2, + #pragma warning restore CS1591 + [EnumMember(Value = "2.2-IV0")] + #pragma warning disable CS1591 + TwoTwoIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.2-IV1")] + #pragma warning disable CS1591 + TwoTwoIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "2.3-IV0")] + #pragma warning disable CS1591 + TwoThreeIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.3-IV1")] + #pragma warning disable CS1591 + TwoThreeIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "2.4-IV0")] + #pragma warning disable CS1591 + TwoFourIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.4-IV1")] + #pragma warning disable CS1591 + TwoFourIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "2.5-IV0")] + #pragma warning disable CS1591 + TwoFiveIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.6-IV0")] + #pragma warning disable CS1591 + TwoSixIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.7-IV0")] + #pragma warning disable CS1591 + TwoSevenIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.7-IV1")] + #pragma warning disable CS1591 + TwoSevenIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "2.7-IV2")] + #pragma warning disable CS1591 + TwoSevenIV2, + #pragma warning restore CS1591 + [EnumMember(Value = "2.8-IV0")] + #pragma warning disable CS1591 + TwoEightIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "2.8-IV1")] + #pragma warning disable CS1591 + TwoEightIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "3.0-IV0")] + #pragma warning disable CS1591 + ThreeZeroIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "3.0-IV1")] + #pragma warning disable CS1591 + ThreeZeroIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "3.1-IV0")] + #pragma warning disable CS1591 + ThreeOneIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "3.2-IV0")] + #pragma warning disable CS1591 + ThreeTwoIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "3.3-IV0")] + #pragma warning disable CS1591 + ThreeThreeIV0, + #pragma warning restore CS1591 + [EnumMember(Value = "3.3-IV1")] + #pragma warning disable CS1591 + ThreeThreeIV1, + #pragma warning restore CS1591 + [EnumMember(Value = "3.3-IV2")] + #pragma warning disable CS1591 + ThreeThreeIV2, + #pragma warning restore CS1591 + [EnumMember(Value = "3.3-IV3")] + #pragma warning disable CS1591 + ThreeThreeIV3, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_message_timestamp_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_message_timestamp_type.cs new file mode 100644 index 0000000..6888b26 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_config_message_timestamp_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The message_timestamp_type specifies whether to use the message create time or log append time as the timestamp on a message. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_topic_config_message_timestamp_type + { + [EnumMember(Value = "create_time")] + #pragma warning disable CS1591 + Create_time, + #pragma warning restore CS1591 + [EnumMember(Value = "log_append_time")] + #pragma warning disable CS1591 + Log_append_time, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_create.cs new file mode 100644 index 0000000..3912d4a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_create.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic_create : global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_base, IParsable + #pragma warning restore CS1591 + { + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config Config { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("config", Config); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_partition.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_partition.cs new file mode 100644 index 0000000..9fea868 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_partition.cs @@ -0,0 +1,81 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic_partition : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The consumer_groups property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ConsumerGroups { get; set; } +#nullable restore +#else + public List ConsumerGroups { get; set; } +#endif + /// The earliest consumer offset amongst consumer groups. + public int? EarliestOffset { get; set; } + /// An identifier for the partition. + public int? Id { get; set; } + /// The number of nodes that are in-sync (have the latest data) for the given partition + public int? InSyncReplicas { get; set; } + /// Size of the topic partition in bytes. + public int? Size { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kafka_topic_partition() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_partition CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_partition(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "consumer_groups", n => { ConsumerGroups = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_partition_consumer_groups.CreateFromDiscriminatorValue)?.AsList(); } }, + { "earliest_offset", n => { EarliestOffset = n.GetIntValue(); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "in_sync_replicas", n => { InSyncReplicas = n.GetIntValue(); } }, + { "size", n => { Size = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("consumer_groups", ConsumerGroups); + writer.WriteIntValue("earliest_offset", EarliestOffset); + writer.WriteIntValue("id", Id); + writer.WriteIntValue("in_sync_replicas", InSyncReplicas); + writer.WriteIntValue("size", Size); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_partition_consumer_groups.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_partition_consumer_groups.cs new file mode 100644 index 0000000..b722b44 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_partition_consumer_groups.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic_partition_consumer_groups : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Name of the consumer group. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? GroupName { get; set; } +#nullable restore +#else + public string GroupName { get; set; } +#endif + /// The current offset of the consumer group. + public int? Offset { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kafka_topic_partition_consumer_groups() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_partition_consumer_groups CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_partition_consumer_groups(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "group_name", n => { GroupName = n.GetStringValue(); } }, + { "offset", n => { Offset = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("group_name", GroupName); + writer.WriteIntValue("offset", Offset); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_state.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_state.cs new file mode 100644 index 0000000..fe9ff81 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_state.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The state of the Kafka topic. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_topic_state + { + [EnumMember(Value = "active")] + #pragma warning disable CS1591 + Active, + #pragma warning restore CS1591 + [EnumMember(Value = "configuring")] + #pragma warning disable CS1591 + Configuring, + #pragma warning restore CS1591 + [EnumMember(Value = "deleting")] + #pragma warning disable CS1591 + Deleting, + #pragma warning restore CS1591 + [EnumMember(Value = "unknown")] + #pragma warning disable CS1591 + Unknown, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_update.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_update.cs new file mode 100644 index 0000000..8bddbc5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_update.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic_update : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config Config { get; set; } +#endif + /// The number of partitions available for the topic. On update, this value can only be increased. + public int? PartitionCount { get; set; } + /// The number of nodes to replicate data across the cluster. + public int? ReplicationFactor { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kafka_topic_update() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config.CreateFromDiscriminatorValue); } }, + { "partition_count", n => { PartitionCount = n.GetIntValue(); } }, + { "replication_factor", n => { ReplicationFactor = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteIntValue("partition_count", PartitionCount); + writer.WriteIntValue("replication_factor", ReplicationFactor); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_verbose.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_verbose.cs new file mode 100644 index 0000000..fe9324d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_verbose.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kafka_topic_verbose : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config Config { get; set; } +#endif + /// The name of the Kafka topic. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The partitions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Partitions { get; set; } +#nullable restore +#else + public List Partitions { get; set; } +#endif + /// The number of nodes to replicate data across the cluster. + public int? ReplicationFactor { get; set; } + /// The state of the Kafka topic. + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose_state? State { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kafka_topic_verbose() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_config.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "partitions", n => { Partitions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_partition.CreateFromDiscriminatorValue)?.AsList(); } }, + { "replication_factor", n => { ReplicationFactor = n.GetIntValue(); } }, + { "state", n => { State = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfObjectValues("partitions", Partitions); + writer.WriteIntValue("replication_factor", ReplicationFactor); + writer.WriteEnumValue("state", State); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_verbose_state.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_verbose_state.cs new file mode 100644 index 0000000..289bfe8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kafka_topic_verbose_state.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The state of the Kafka topic. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kafka_topic_verbose_state + { + [EnumMember(Value = "active")] + #pragma warning disable CS1591 + Active, + #pragma warning restore CS1591 + [EnumMember(Value = "configuring")] + #pragma warning disable CS1591 + Configuring, + #pragma warning restore CS1591 + [EnumMember(Value = "deleting")] + #pragma warning disable CS1591 + Deleting, + #pragma warning restore CS1591 + [EnumMember(Value = "unknown")] + #pragma warning disable CS1591 + Unknown, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kernel.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kernel.cs new file mode 100644 index 0000000..d159a08 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kernel.cs @@ -0,0 +1,81 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// **Note**: All Droplets created after March 2017 use internal kernels by default.These Droplets will have this attribute set to `null`.The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/)for Droplets with externally managed kernels. This will initially be set tothe kernel of the base image when the Droplet is created. + /// + [Obsolete("")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Kernel : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A unique number used to identify and reference a specific kernel. + public int? Id { get; set; } + /// The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A standard kernel version string representing the version, patch, and release information. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kernel() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kernel CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kernel(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("version", Version); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool.cs new file mode 100644 index 0000000..2696e8b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool.cs @@ -0,0 +1,133 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_node_pool : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether auto-scaling is enabled for this node pool. + public bool? AutoScale { get; set; } + /// The number of Droplet instances in the node pool. + public int? Count { get; set; } + /// A unique ID that can be used to identify and reference a specific node pool. + public Guid? Id { get; private set; } + /// An object of key/value mappings specifying labels to apply to all nodes in a pool. Labels will automatically be applied to all existing nodes and any subsequent nodes added to the pool. Note that when a label is removed, it is not deleted from the nodes in the pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_labels? Labels { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_labels Labels { get; set; } +#endif + /// The maximum number of nodes that this node pool can be auto-scaled to. The value will be `0` if `auto_scale` is set to `false`. + public int? MaxNodes { get; set; } + /// The minimum number of nodes that this node pool can be auto-scaled to. The value will be `0` if `auto_scale` is set to `false`. + public int? MinNodes { get; set; } + /// A human-readable name for the node pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An object specifying the details of a specific worker node in a node pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Nodes { get; private set; } +#nullable restore +#else + public List Nodes { get; private set; } +#endif + /// The slug identifier for the type of Droplet used as workers in the node pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Size { get; set; } +#nullable restore +#else + public string Size { get; set; } +#endif + /// An array containing the tags applied to the node pool. All node pools are automatically tagged `k8s`, `k8s-worker`, and `k8s:$K8S_CLUSTER_ID`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// An array of taints to apply to all nodes in a pool. Taints will automatically be applied to all existing nodes and any subsequent nodes added to the pool. When a taint is removed, it is deleted from all nodes in the pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Taints { get; set; } +#nullable restore +#else + public List Taints { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_node_pool() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auto_scale", n => { AutoScale = n.GetBoolValue(); } }, + { "count", n => { Count = n.GetIntValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "labels", n => { Labels = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_labels.CreateFromDiscriminatorValue); } }, + { "max_nodes", n => { MaxNodes = n.GetIntValue(); } }, + { "min_nodes", n => { MinNodes = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "nodes", n => { Nodes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Node.CreateFromDiscriminatorValue)?.AsList(); } }, + { "size", n => { Size = n.GetStringValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "taints", n => { Taints = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_taint.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("auto_scale", AutoScale); + writer.WriteIntValue("count", Count); + writer.WriteObjectValue("labels", Labels); + writer.WriteIntValue("max_nodes", MaxNodes); + writer.WriteIntValue("min_nodes", MinNodes); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("size", Size); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteCollectionOfObjectValues("taints", Taints); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_labels.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_labels.cs new file mode 100644 index 0000000..183ce87 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_labels.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object of key/value mappings specifying labels to apply to all nodes in a pool. Labels will automatically be applied to all existing nodes and any subsequent nodes added to the pool. Note that when a label is removed, it is not deleted from the nodes in the pool. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Kubernetes_node_pool_labels : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_node_pool_labels() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_labels CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_labels(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_taint.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_taint.cs new file mode 100644 index 0000000..7c22b4e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_taint.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_node_pool_taint : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// How the node reacts to pods that it won't tolerate. Available effect values are `NoSchedule`, `PreferNoSchedule`, and `NoExecute`. + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_taint_effect? Effect { get; set; } + /// An arbitrary string. The `key` and `value` fields of the `taint` object form a key-value pair. For example, if the value of the `key` field is "special" and the value of the `value` field is "gpu", the key value pair would be `special=gpu`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// An arbitrary string. The `key` and `value` fields of the `taint` object form a key-value pair. For example, if the value of the `key` field is "special" and the value of the `value` field is "gpu", the key value pair would be `special=gpu`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_node_pool_taint() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_taint CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_taint(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "effect", n => { Effect = n.GetEnumValue(); } }, + { "key", n => { Key = n.GetStringValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("effect", Effect); + writer.WriteStringValue("key", Key); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_taint_effect.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_taint_effect.cs new file mode 100644 index 0000000..05c5153 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_taint_effect.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// How the node reacts to pods that it won't tolerate. Available effect values are `NoSchedule`, `PreferNoSchedule`, and `NoExecute`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Kubernetes_node_pool_taint_effect + { + [EnumMember(Value = "NoSchedule")] + #pragma warning disable CS1591 + NoSchedule, + #pragma warning restore CS1591 + [EnumMember(Value = "PreferNoSchedule")] + #pragma warning disable CS1591 + PreferNoSchedule, + #pragma warning restore CS1591 + [EnumMember(Value = "NoExecute")] + #pragma warning disable CS1591 + NoExecute, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_update.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_update.cs new file mode 100644 index 0000000..943cc08 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_update.cs @@ -0,0 +1,123 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_node_pool_update : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether auto-scaling is enabled for this node pool. + public bool? AutoScale { get; set; } + /// The number of Droplet instances in the node pool. + public int? Count { get; set; } + /// A unique ID that can be used to identify and reference a specific node pool. + public Guid? Id { get; private set; } + /// An object of key/value mappings specifying labels to apply to all nodes in a pool. Labels will automatically be applied to all existing nodes and any subsequent nodes added to the pool. Note that when a label is removed, it is not deleted from the nodes in the pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update_labels? Labels { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update_labels Labels { get; set; } +#endif + /// The maximum number of nodes that this node pool can be auto-scaled to. The value will be `0` if `auto_scale` is set to `false`. + public int? MaxNodes { get; set; } + /// The minimum number of nodes that this node pool can be auto-scaled to. The value will be `0` if `auto_scale` is set to `false`. + public int? MinNodes { get; set; } + /// A human-readable name for the node pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An object specifying the details of a specific worker node in a node pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Nodes { get; private set; } +#nullable restore +#else + public List Nodes { get; private set; } +#endif + /// An array containing the tags applied to the node pool. All node pools are automatically tagged `k8s`, `k8s-worker`, and `k8s:$K8S_CLUSTER_ID`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// An array of taints to apply to all nodes in a pool. Taints will automatically be applied to all existing nodes and any subsequent nodes added to the pool. When a taint is removed, it is deleted from all nodes in the pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Taints { get; set; } +#nullable restore +#else + public List Taints { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_node_pool_update() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auto_scale", n => { AutoScale = n.GetBoolValue(); } }, + { "count", n => { Count = n.GetIntValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "labels", n => { Labels = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update_labels.CreateFromDiscriminatorValue); } }, + { "max_nodes", n => { MaxNodes = n.GetIntValue(); } }, + { "min_nodes", n => { MinNodes = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "nodes", n => { Nodes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Node.CreateFromDiscriminatorValue)?.AsList(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "taints", n => { Taints = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_taint.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("auto_scale", AutoScale); + writer.WriteIntValue("count", Count); + writer.WriteObjectValue("labels", Labels); + writer.WriteIntValue("max_nodes", MaxNodes); + writer.WriteIntValue("min_nodes", MinNodes); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteCollectionOfObjectValues("taints", Taints); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_update_labels.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_update_labels.cs new file mode 100644 index 0000000..ec813e2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_node_pool_update_labels.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object of key/value mappings specifying labels to apply to all nodes in a pool. Labels will automatically be applied to all existing nodes and any subsequent nodes added to the pool. Note that when a label is removed, it is not deleted from the nodes in the pool. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Kubernetes_node_pool_update_labels : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_node_pool_update_labels() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update_labels CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update_labels(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_options.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_options.cs new file mode 100644 index 0000000..ee60bab --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_options.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_options : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The options property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options_options? Options { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options_options Options { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "options", n => { Options = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options_options.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("options", Options); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_options_options.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_options_options.cs new file mode 100644 index 0000000..7e4cc42 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_options_options.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_options_options : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The regions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// The sizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Sizes { get; set; } +#nullable restore +#else + public List Sizes { get; set; } +#endif + /// The versions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; set; } +#nullable restore +#else + public List Versions { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_options_options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options_options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "regions", n => { Regions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_region.CreateFromDiscriminatorValue)?.AsList(); } }, + { "sizes", n => { Sizes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_size.CreateFromDiscriminatorValue)?.AsList(); } }, + { "versions", n => { Versions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_version.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("regions", Regions); + writer.WriteCollectionOfObjectValues("sizes", Sizes); + writer.WriteCollectionOfObjectValues("versions", Versions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_region.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_region.cs new file mode 100644 index 0000000..278da59 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_region.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_region : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A DigitalOcean region where Kubernetes is available. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The identifier for a region for use when creating a new cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_region() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_region CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_region(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("slug", Slug); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_size.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_size.cs new file mode 100644 index 0000000..bd9c4f1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_size.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_size : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A Droplet size available for use in a Kubernetes node pool. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The identifier for a size for use when creating a new cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_size() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_size CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_size(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("slug", Slug); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_version.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_version.cs new file mode 100644 index 0000000..f4987e1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Kubernetes_version.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Kubernetes_version : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The upstream version string for the version of Kubernetes provided by a given slug. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? KubernetesVersion { get; set; } +#nullable restore +#else + public string KubernetesVersion { get; set; } +#endif + /// The slug identifier for an available version of Kubernetes for use when creating or updating a cluster. The string contains both the upstream version of Kubernetes as well as the DigitalOcean revision. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// The features available with the version of Kubernetes provided by a given slug. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SupportedFeatures { get; set; } +#nullable restore +#else + public List SupportedFeatures { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Kubernetes_version() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_version CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_version(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kubernetes_version", n => { KubernetesVersion = n.GetStringValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + { "supported_features", n => { SupportedFeatures = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("kubernetes_version", KubernetesVersion); + writer.WriteStringValue("slug", Slug); + writer.WriteCollectionOfPrimitiveValues("supported_features", SupportedFeatures); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Lb_firewall.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Lb_firewall.cs new file mode 100644 index 0000000..d9a8b4e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Lb_firewall.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object specifying allow and deny rules to control traffic to the load balancer. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Lb_firewall : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Allow { get; set; } +#nullable restore +#else + public List Allow { get; set; } +#endif + /// the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Deny { get; set; } +#nullable restore +#else + public List Deny { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Lb_firewall() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Lb_firewall CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Lb_firewall(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allow", n => { Allow = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "deny", n => { Deny = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("allow", Allow); + writer.WriteCollectionOfPrimitiveValues("deny", Deny); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer.cs new file mode 100644 index 0000000..2065aa5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Load_balancer : global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base, IParsable + #pragma warning restore CS1591 + { + /// An array containing the IDs of the Droplets assigned to the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; set; } +#nullable restore +#else + public List DropletIds { get; set; } +#endif + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_region? Region { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_region Region { get; set; } +#endif + /// The name of a Droplet tag corresponding to Droplets assigned to the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Tag { get; set; } +#nullable restore +#else + public string Tag { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "region", n => { Region = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_region.CreateFromDiscriminatorValue); } }, + { "tag", n => { Tag = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfPrimitiveValues("droplet_ids", DropletIds); + writer.WriteObjectValue("region", Region); + writer.WriteStringValue("tag", Tag); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base.cs new file mode 100644 index 0000000..a54a718 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base.cs @@ -0,0 +1,178 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Load_balancer_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// This field has been deprecated. You can no longer specify an algorithm for load balancers. + [Obsolete("")] + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base_algorithm? Algorithm { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the load balancer was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. + public bool? DisableLetsEncryptDnsRecords { get; set; } + /// A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. + public bool? EnableBackendKeepalive { get; set; } + /// A boolean value indicating whether PROXY Protocol is in use. + public bool? EnableProxyProtocol { get; set; } + /// An object specifying allow and deny rules to control traffic to the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Lb_firewall? Firewall { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Lb_firewall Firewall { get; set; } +#endif + /// An array of objects specifying the forwarding rules for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ForwardingRules { get; set; } +#nullable restore +#else + public List ForwardingRules { get; set; } +#endif + /// An object specifying health check settings for the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Health_check? HealthCheck { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Health_check HealthCheck { get; set; } +#endif + /// An integer value which configures the idle timeout for HTTP requests to the target droplets. + public int? HttpIdleTimeoutSeconds { get; set; } + /// A unique ID that can be used to identify and reference a load balancer. + public Guid? Id { get; private set; } + /// An attribute containing the public-facing IP address of the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ip { get; private set; } +#nullable restore +#else + public string Ip { get; private set; } +#endif + /// A human-readable name for a load balancer instance. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base_network? Network { get; set; } + /// The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProjectId { get; set; } +#nullable restore +#else + public string ProjectId { get; set; } +#endif + /// A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. + public bool? RedirectHttpToHttps { get; set; } + /// This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes.* `lb-small` = 1 node* `lb-medium` = 3 nodes* `lb-large` = 6 nodesYou can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. + [Obsolete("")] + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base_size? Size { get; set; } + /// How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. + public int? SizeUnit { get; set; } + /// A status string indicating the current state of the load balancer. This can be `new`, `active`, or `errored`. + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base_status? Status { get; private set; } + /// An object specifying sticky sessions settings for the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Sticky_sessions? StickySessions { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Sticky_sessions StickySessions { get; set; } +#endif + /// A string specifying the UUID of the VPC to which the load balancer is assigned. + public Guid? VpcUuid { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Load_balancer_base() + { + AdditionalData = new Dictionary(); + Algorithm = global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base_algorithm.Round_robin; + Network = global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base_network.EXTERNAL; + Size = global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base_size.LbSmall; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "algorithm", n => { Algorithm = n.GetEnumValue(); } }, + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "disable_lets_encrypt_dns_records", n => { DisableLetsEncryptDnsRecords = n.GetBoolValue(); } }, + { "enable_backend_keepalive", n => { EnableBackendKeepalive = n.GetBoolValue(); } }, + { "enable_proxy_protocol", n => { EnableProxyProtocol = n.GetBoolValue(); } }, + { "firewall", n => { Firewall = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Lb_firewall.CreateFromDiscriminatorValue); } }, + { "forwarding_rules", n => { ForwardingRules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Forwarding_rule.CreateFromDiscriminatorValue)?.AsList(); } }, + { "health_check", n => { HealthCheck = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Health_check.CreateFromDiscriminatorValue); } }, + { "http_idle_timeout_seconds", n => { HttpIdleTimeoutSeconds = n.GetIntValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "ip", n => { Ip = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "network", n => { Network = n.GetEnumValue(); } }, + { "project_id", n => { ProjectId = n.GetStringValue(); } }, + { "redirect_http_to_https", n => { RedirectHttpToHttps = n.GetBoolValue(); } }, + { "size", n => { Size = n.GetEnumValue(); } }, + { "size_unit", n => { SizeUnit = n.GetIntValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "sticky_sessions", n => { StickySessions = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Sticky_sessions.CreateFromDiscriminatorValue); } }, + { "vpc_uuid", n => { VpcUuid = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("algorithm", Algorithm); + writer.WriteBoolValue("disable_lets_encrypt_dns_records", DisableLetsEncryptDnsRecords); + writer.WriteBoolValue("enable_backend_keepalive", EnableBackendKeepalive); + writer.WriteBoolValue("enable_proxy_protocol", EnableProxyProtocol); + writer.WriteObjectValue("firewall", Firewall); + writer.WriteCollectionOfObjectValues("forwarding_rules", ForwardingRules); + writer.WriteObjectValue("health_check", HealthCheck); + writer.WriteIntValue("http_idle_timeout_seconds", HttpIdleTimeoutSeconds); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("network", Network); + writer.WriteStringValue("project_id", ProjectId); + writer.WriteBoolValue("redirect_http_to_https", RedirectHttpToHttps); + writer.WriteEnumValue("size", Size); + writer.WriteIntValue("size_unit", SizeUnit); + writer.WriteObjectValue("sticky_sessions", StickySessions); + writer.WriteGuidValue("vpc_uuid", VpcUuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_algorithm.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_algorithm.cs new file mode 100644 index 0000000..acd01bc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_algorithm.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// This field has been deprecated. You can no longer specify an algorithm for load balancers. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + [Obsolete("")] + public enum Load_balancer_base_algorithm + { + [EnumMember(Value = "round_robin")] + #pragma warning disable CS1591 + Round_robin, + #pragma warning restore CS1591 + [EnumMember(Value = "least_connections")] + #pragma warning disable CS1591 + Least_connections, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_network.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_network.cs new file mode 100644 index 0000000..78a392e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_network.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Load_balancer_base_network + { + [EnumMember(Value = "EXTERNAL")] + #pragma warning disable CS1591 + EXTERNAL, + #pragma warning restore CS1591 + [EnumMember(Value = "INTERNAL")] + #pragma warning disable CS1591 + INTERNAL, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_size.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_size.cs new file mode 100644 index 0000000..657ac64 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_size.cs @@ -0,0 +1,24 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes.* `lb-small` = 1 node* `lb-medium` = 3 nodes* `lb-large` = 6 nodesYou can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + [Obsolete("")] + public enum Load_balancer_base_size + { + [EnumMember(Value = "lb-small")] + #pragma warning disable CS1591 + LbSmall, + #pragma warning restore CS1591 + [EnumMember(Value = "lb-medium")] + #pragma warning disable CS1591 + LbMedium, + #pragma warning restore CS1591 + [EnumMember(Value = "lb-large")] + #pragma warning disable CS1591 + LbLarge, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_status.cs new file mode 100644 index 0000000..604f960 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_base_status.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A status string indicating the current state of the load balancer. This can be `new`, `active`, or `errored`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Load_balancer_base_status + { + [EnumMember(Value = "new")] + #pragma warning disable CS1591 + New, + #pragma warning restore CS1591 + [EnumMember(Value = "active")] + #pragma warning disable CS1591 + Active, + #pragma warning restore CS1591 + [EnumMember(Value = "errored")] + #pragma warning disable CS1591 + Errored, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_region.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_region.cs new file mode 100644 index 0000000..a3aa648 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Load_balancer_region.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The region where the load balancer instance is located. When setting a region, the value should be the slug identifier for the region. When you query a load balancer, an entire region object will be returned. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_balancer_region : global::InfinityFlow.DigitalOcean.Client.Models.Region, IParsable + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_region CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer_region(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base.cs new file mode 100644 index 0000000..00ab023 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Logsink_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the Logsink +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SinkName { get; set; } +#nullable restore +#else + public string SinkName { get; set; } +#endif + /// The sink_type property + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base_sink_type? SinkType { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Logsink_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sink_name", n => { SinkName = n.GetStringValue(); } }, + { "sink_type", n => { SinkType = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("sink_name", SinkName); + writer.WriteEnumValue("sink_type", SinkType); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_sink_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_sink_type.cs new file mode 100644 index 0000000..df78c2d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_sink_type.cs @@ -0,0 +1,24 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Logsink_base_sink_type + #pragma warning restore CS1591 + { + [EnumMember(Value = "rsyslog")] + #pragma warning disable CS1591 + Rsyslog, + #pragma warning restore CS1591 + [EnumMember(Value = "elasticsearch")] + #pragma warning disable CS1591 + Elasticsearch, + #pragma warning restore CS1591 + [EnumMember(Value = "opensearch")] + #pragma warning disable CS1591 + Opensearch, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_verbose.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_verbose.cs new file mode 100644 index 0000000..57450a0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_verbose.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Logsink_base_verbose : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A unique identifier for Logsink +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SinkId { get; set; } +#nullable restore +#else + public string SinkId { get; set; } +#endif + /// The name of the Logsink +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SinkName { get; set; } +#nullable restore +#else + public string SinkName { get; set; } +#endif + /// The sink_type property + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base_verbose_sink_type? SinkType { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Logsink_base_verbose() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base_verbose CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base_verbose(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sink_id", n => { SinkId = n.GetStringValue(); } }, + { "sink_name", n => { SinkName = n.GetStringValue(); } }, + { "sink_type", n => { SinkType = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("sink_id", SinkId); + writer.WriteStringValue("sink_name", SinkName); + writer.WriteEnumValue("sink_type", SinkType); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_verbose_sink_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_verbose_sink_type.cs new file mode 100644 index 0000000..240f4b4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_base_verbose_sink_type.cs @@ -0,0 +1,24 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Logsink_base_verbose_sink_type + #pragma warning restore CS1591 + { + [EnumMember(Value = "rsyslog")] + #pragma warning disable CS1591 + Rsyslog, + #pragma warning restore CS1591 + [EnumMember(Value = "elasticsearch")] + #pragma warning disable CS1591 + Elasticsearch, + #pragma warning restore CS1591 + [EnumMember(Value = "opensearch")] + #pragma warning disable CS1591 + Opensearch, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_create.cs new file mode 100644 index 0000000..068a876 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_create.cs @@ -0,0 +1,122 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Logsink_create : global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base, IParsable + #pragma warning restore CS1591 + { + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create.Logsink_create_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create.Logsink_create_config Config { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create.Logsink_create_config.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("config", Config); + } + /// + /// Composed type wrapper for classes , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Logsink_create_config : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink? ElasticsearchLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink ElasticsearchLogsink { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink? OpensearchLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink OpensearchLogsink { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink? RsyslogLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink RsyslogLogsink { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create.Logsink_create_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create.Logsink_create_config(); + result.ElasticsearchLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink(); + result.OpensearchLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink(); + result.RsyslogLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(ElasticsearchLogsink != null || OpensearchLogsink != null || RsyslogLogsink != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(ElasticsearchLogsink, OpensearchLogsink, RsyslogLogsink); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, ElasticsearchLogsink, OpensearchLogsink, RsyslogLogsink); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_update.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_update.cs new file mode 100644 index 0000000..dbb957d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_update.cs @@ -0,0 +1,131 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Logsink_update : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update.Logsink_update_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update.Logsink_update_config Config { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Logsink_update() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update.Logsink_update_config.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Logsink_update_config : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink? ElasticsearchLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink ElasticsearchLogsink { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink? OpensearchLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink OpensearchLogsink { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink? RsyslogLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink RsyslogLogsink { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update.Logsink_update_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update.Logsink_update_config(); + result.ElasticsearchLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink(); + result.OpensearchLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink(); + result.RsyslogLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(ElasticsearchLogsink != null || OpensearchLogsink != null || RsyslogLogsink != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(ElasticsearchLogsink, OpensearchLogsink, RsyslogLogsink); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, ElasticsearchLogsink, OpensearchLogsink, RsyslogLogsink); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_verbose.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_verbose.cs new file mode 100644 index 0000000..99b19e4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Logsink_verbose.cs @@ -0,0 +1,122 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Logsink_verbose : global::InfinityFlow.DigitalOcean.Client.Models.Logsink_base_verbose, IParsable + #pragma warning restore CS1591 + { + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.Logsink_verbose_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.Logsink_verbose_config Config { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.Logsink_verbose_config.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("config", Config); + } + /// + /// Composed type wrapper for classes , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Logsink_verbose_config : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink? ElasticsearchLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink ElasticsearchLogsink { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink? OpensearchLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink OpensearchLogsink { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink? RsyslogLogsink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink RsyslogLogsink { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.Logsink_verbose_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.Logsink_verbose_config(); + result.ElasticsearchLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Elasticsearch_logsink(); + result.OpensearchLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink(); + result.RsyslogLogsink = new global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(ElasticsearchLogsink != null || OpensearchLogsink != null || RsyslogLogsink != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(ElasticsearchLogsink, OpensearchLogsink, RsyslogLogsink); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, ElasticsearchLogsink, OpensearchLogsink, RsyslogLogsink); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Maintenance_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Maintenance_policy.cs new file mode 100644 index 0000000..9e91c70 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Maintenance_policy.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object specifying the maintenance window policy for the Kubernetes cluster. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Maintenance_policy : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The day of the maintenance window policy. May be one of `monday` through `sunday`, or `any` to indicate an arbitrary week day. + public global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy_day? Day { get; set; } + /// The duration of the maintenance window policy in human-readable format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Duration { get; private set; } +#nullable restore +#else + public string Duration { get; private set; } +#endif + /// The start time in UTC of the maintenance window policy in 24-hour clock format / HH:MM notation (e.g., `15:00`). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? StartTime { get; set; } +#nullable restore +#else + public string StartTime { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Maintenance_policy() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Maintenance_policy(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "day", n => { Day = n.GetEnumValue(); } }, + { "duration", n => { Duration = n.GetStringValue(); } }, + { "start_time", n => { StartTime = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("day", Day); + writer.WriteStringValue("start_time", StartTime); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Maintenance_policy_day.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Maintenance_policy_day.cs new file mode 100644 index 0000000..c7e83f3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Maintenance_policy_day.cs @@ -0,0 +1,43 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The day of the maintenance window policy. May be one of `monday` through `sunday`, or `any` to indicate an arbitrary week day. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Maintenance_policy_day + { + [EnumMember(Value = "any")] + #pragma warning disable CS1591 + Any, + #pragma warning restore CS1591 + [EnumMember(Value = "monday")] + #pragma warning disable CS1591 + Monday, + #pragma warning restore CS1591 + [EnumMember(Value = "tuesday")] + #pragma warning disable CS1591 + Tuesday, + #pragma warning restore CS1591 + [EnumMember(Value = "wednesday")] + #pragma warning disable CS1591 + Wednesday, + #pragma warning restore CS1591 + [EnumMember(Value = "thursday")] + #pragma warning disable CS1591 + Thursday, + #pragma warning restore CS1591 + [EnumMember(Value = "friday")] + #pragma warning disable CS1591 + Friday, + #pragma warning restore CS1591 + [EnumMember(Value = "saturday")] + #pragma warning disable CS1591 + Saturday, + #pragma warning restore CS1591 + [EnumMember(Value = "sunday")] + #pragma warning disable CS1591 + Sunday, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Meta_properties.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Meta_properties.cs new file mode 100644 index 0000000..9e387bb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Meta_properties.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Information about the response itself. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Meta_properties : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Number of objects returned by the request. + public int? Total { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Meta_properties() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "total", n => { Total = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("total", Total); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Metrics.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics.cs new file mode 100644 index 0000000..4170fe7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Metrics : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Metrics_data? Data { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Metrics_data Data { get; set; } +#endif + /// The status property + public global::InfinityFlow.DigitalOcean.Client.Models.Metrics_status? Status { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Metrics() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Metrics CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Metrics(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Metrics_data.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("status", Status); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_data.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_data.cs new file mode 100644 index 0000000..97252f5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_data.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Metrics_data : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Result of query. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Result { get; set; } +#nullable restore +#else + public List Result { get; set; } +#endif + /// The resultType property + public global::InfinityFlow.DigitalOcean.Client.Models.Metrics_data_resultType? ResultType { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Metrics_data() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Metrics_data CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Metrics_data(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "result", n => { Result = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result.CreateFromDiscriminatorValue)?.AsList(); } }, + { "resultType", n => { ResultType = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("result", Result); + writer.WriteEnumValue("resultType", ResultType); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_data_resultType.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_data_resultType.cs new file mode 100644 index 0000000..282c217 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_data_resultType.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Metrics_data_resultType + #pragma warning restore CS1591 + { + [EnumMember(Value = "matrix")] + #pragma warning disable CS1591 + Matrix, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_result.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_result.cs new file mode 100644 index 0000000..aee71ef --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_result.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Metrics_result : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An object containing the metric's labels. These labels are key/value pairs that vary depending on the metric being queried. For example, load balancer metrics contain a `lb_id` label, while Droplet metrics contain a `host_id` label, and App Platform metrics contain a `app_component` label. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result_metric? Metric { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result_metric Metric { get; set; } +#endif + /// An array of values for the metric. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UntypedNode? Values { get; set; } +#nullable restore +#else + public UntypedNode Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Metrics_result() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "metric", n => { Metric = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result_metric.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(UntypedNode.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("metric", Metric); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_result_metric.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_result_metric.cs new file mode 100644 index 0000000..d193e8c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_result_metric.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing the metric's labels. These labels are key/value pairs that vary depending on the metric being queried. For example, load balancer metrics contain a `lb_id` label, while Droplet metrics contain a `host_id` label, and App Platform metrics contain a `app_component` label. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Metrics_result_metric : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Metrics_result_metric() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result_metric CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Metrics_result_metric(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_status.cs new file mode 100644 index 0000000..4430967 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Metrics_status.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Metrics_status + #pragma warning restore CS1591 + { + [EnumMember(Value = "success")] + #pragma warning disable CS1591 + Success, + #pragma warning restore CS1591 + [EnumMember(Value = "error")] + #pragma warning disable CS1591 + Error, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Mongo_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Mongo_advanced_config.cs new file mode 100644 index 0000000..d7aaf3d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Mongo_advanced_config.cs @@ -0,0 +1,83 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Mongo_advanced_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Specifies the default consistency behavior of reads from the database. Data that is returned from the query with may or may not have been acknowledged by all nodes in the replicaset depending on this value. Learn more [here](https://www.mongodb.com/docs/manual/reference/read-concern/). + public global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config_default_read_concern? DefaultReadConcern { get; set; } + /// Describes the level of acknowledgment requested from MongoDB for write operations clusters. This field can set to either `majority` or a number `0...n` which will describe the number of nodes that must acknowledge the write operation before it is fully accepted. Setting to `0` will request no acknowledgement of the write operation. Learn more [here](https://www.mongodb.com/docs/manual/reference/write-concern/). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DefaultWriteConcern { get; set; } +#nullable restore +#else + public string DefaultWriteConcern { get; set; } +#endif + /// Operations that run for longer than this threshold are considered slow which are then recorded to the diagnostic logs. Higher log levels (verbosity) will record all operations regardless of this threshold on the primary node. *Changing this parameter will lead to a restart of the MongoDB service.* Learn more [here](https://www.mongodb.com/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpThresholdMs). + public int? SlowOpThresholdMs { get; set; } + /// Specifies the lifetime of multi-document transactions. Transactions that exceed this limit are considered expired and will be aborted by a periodic cleanup process. The cleanup process runs every `transactionLifetimeLimitSeconds/2 seconds` or at least once every 60 seconds. *Changing this parameter will lead to a restart of the MongoDB service.* Learn more [here](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.transactionLifetimeLimitSeconds). + public int? TransactionLifetimeLimitSeconds { get; set; } + /// The log message verbosity level. The verbosity level determines the amount of Informational and Debug messages MongoDB outputs. 0 includes informational messages while 1...5 increases the level to include debug messages. *Changing this parameter will lead to a restart of the MongoDB service.* Learn more [here](https://www.mongodb.com/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.verbosity). + public int? Verbosity { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Mongo_advanced_config() + { + AdditionalData = new Dictionary(); + DefaultReadConcern = global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config_default_read_concern.Local; + DefaultWriteConcern = "majority"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "default_read_concern", n => { DefaultReadConcern = n.GetEnumValue(); } }, + { "default_write_concern", n => { DefaultWriteConcern = n.GetStringValue(); } }, + { "slow_op_threshold_ms", n => { SlowOpThresholdMs = n.GetIntValue(); } }, + { "transaction_lifetime_limit_seconds", n => { TransactionLifetimeLimitSeconds = n.GetIntValue(); } }, + { "verbosity", n => { Verbosity = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("default_read_concern", DefaultReadConcern); + writer.WriteStringValue("default_write_concern", DefaultWriteConcern); + writer.WriteIntValue("slow_op_threshold_ms", SlowOpThresholdMs); + writer.WriteIntValue("transaction_lifetime_limit_seconds", TransactionLifetimeLimitSeconds); + writer.WriteIntValue("verbosity", Verbosity); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Mongo_advanced_config_default_read_concern.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Mongo_advanced_config_default_read_concern.cs new file mode 100644 index 0000000..f9c4129 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Mongo_advanced_config_default_read_concern.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Specifies the default consistency behavior of reads from the database. Data that is returned from the query with may or may not have been acknowledged by all nodes in the replicaset depending on this value. Learn more [here](https://www.mongodb.com/docs/manual/reference/read-concern/). + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Mongo_advanced_config_default_read_concern + { + [EnumMember(Value = "local")] + #pragma warning disable CS1591 + Local, + #pragma warning restore CS1591 + [EnumMember(Value = "available")] + #pragma warning disable CS1591 + Available, + #pragma warning restore CS1591 + [EnumMember(Value = "majority")] + #pragma warning disable CS1591 + Majority, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config.cs new file mode 100644 index 0000000..849a34d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config.cs @@ -0,0 +1,210 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Mysql_advanced_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The hour of day (in UTC) when backup for the service starts. New backup only starts if previous backup has already completed. + public int? BackupHour { get; set; } + /// The minute of the backup hour when backup for the service starts. New backup only starts if previous backup has already completed. + public int? BackupMinute { get; set; } + /// The minimum amount of time, in seconds, to keep binlog entries before deletion. This may be extended for services that require binlog entries for longer than the default, for example if using the MySQL Debezium Kafka connector. + public double? BinlogRetentionPeriod { get; set; } + /// The number of seconds that the mysqld server waits for a connect packet before responding with bad handshake. + public int? ConnectTimeout { get; set; } + /// Default server time zone, in the form of an offset from UTC (from -12:00 to +12:00), a time zone name (EST), or 'SYSTEM' to use the MySQL server default. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DefaultTimeZone { get; set; } +#nullable restore +#else + public string DefaultTimeZone { get; set; } +#endif + /// The maximum permitted result length, in bytes, for the GROUP_CONCAT() function. + public int? GroupConcatMaxLen { get; set; } + /// The time, in seconds, before cached statistics expire. + public int? InformationSchemaStatsExpiry { get; set; } + /// Specifies the maximum size of the InnoDB change buffer as a percentage of the buffer pool. + public int? InnodbChangeBufferMaxSize { get; set; } + /// Specifies whether flushing a page from the InnoDB buffer pool also flushes other dirty pages in the same extent. - 0 &mdash; disables this functionality, dirty pages in the same extent are not flushed. - 1 &mdash; flushes contiguous dirty pages in the same extent. - 2 &mdash; flushes dirty pages in the same extent. + public int? InnodbFlushNeighbors { get; set; } + /// The minimum length of words that an InnoDB FULLTEXT index stores. + public int? InnodbFtMinTokenSize { get; set; } + /// The InnoDB FULLTEXT index stopword list for all InnoDB tables. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InnodbFtServerStopwordTable { get; set; } +#nullable restore +#else + public string InnodbFtServerStopwordTable { get; set; } +#endif + /// The time, in seconds, that an InnoDB transaction waits for a row lock. before giving up. + public int? InnodbLockWaitTimeout { get; set; } + /// The size of the buffer, in bytes, that InnoDB uses to write to the log files. on disk. + public int? InnodbLogBufferSize { get; set; } + /// The upper limit, in bytes, of the size of the temporary log files used during online DDL operations for InnoDB tables. + public int? InnodbOnlineAlterLogMaxSize { get; set; } + /// When enabled, records information about all deadlocks in InnoDB user transactions in the error log. Disabled by default. + public bool? InnodbPrintAllDeadlocks { get; set; } + /// The number of I/O threads for read operations in InnoDB. Changing this parameter will lead to a restart of the MySQL service. + public int? InnodbReadIoThreads { get; set; } + /// When enabled, transaction timeouts cause InnoDB to abort and roll back the entire transaction. + public bool? InnodbRollbackOnTimeout { get; set; } + /// Defines the maximum number of threads permitted inside of InnoDB. A value of 0 (the default) is interpreted as infinite concurrency (no limit). This variable is intended for performance tuning on high concurrency systems. + public int? InnodbThreadConcurrency { get; set; } + /// The number of I/O threads for write operations in InnoDB. Changing this parameter will lead to a restart of the MySQL service. + public int? InnodbWriteIoThreads { get; set; } + /// The time, in seconds, the server waits for activity on an interactive. connection before closing it. + public int? InteractiveTimeout { get; set; } + /// The storage engine for in-memory internal temporary tables. + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config_internal_tmp_mem_storage_engine? InternalTmpMemStorageEngine { get; set; } + /// Defines the destination for logs. Can be `INSIGHTS`, `TABLE`, or both (`INSIGHTS,TABLE`), or `NONE` to disable logs. To specify both destinations, use `INSIGHTS,TABLE` (order matters). Default is NONE. + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config_log_output? LogOutput { get; set; } + /// The time, in seconds, for a query to take to execute before being captured by slow_query_logs. Default is 10 seconds. + public double? LongQueryTime { get; set; } + /// The size of the largest message, in bytes, that can be received by the server. Default is 67108864 (64M). + public int? MaxAllowedPacket { get; set; } + /// The maximum size, in bytes, of internal in-memory tables. Also set tmp_table_size. Default is 16777216 (16M) + public int? MaxHeapTableSize { get; set; } + /// Start sizes of connection buffer and result buffer, must be multiple of 1024. Changing this parameter will lead to a restart of the MySQL service. + public int? NetBufferLength { get; set; } + /// The time, in seconds, to wait for more data from an existing connection. aborting the read. + public int? NetReadTimeout { get; set; } + /// The number of seconds to wait for a block to be written to a connection before aborting the write. + public int? NetWriteTimeout { get; set; } + /// When enabled, captures slow queries. When disabled, also truncates the mysql.slow_log table. Default is false. + public bool? SlowQueryLog { get; set; } + /// The sort buffer size, in bytes, for ORDER BY optimization. Default is 262144. (256K). + public int? SortBufferSize { get; set; } + /// Global SQL mode. If empty, uses MySQL server defaults. Must only include uppercase alphabetic characters, underscores, and commas. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SqlMode { get; set; } +#nullable restore +#else + public string SqlMode { get; set; } +#endif + /// Require primary key to be defined for new tables or old tables modified with ALTER TABLE and fail if missing. It is recommended to always have primary keys because various functionality may break if any large table is missing them. + public bool? SqlRequirePrimaryKey { get; set; } + /// The maximum size, in bytes, of internal in-memory tables. Also set max_heap_table_size. Default is 16777216 (16M). + public int? TmpTableSize { get; set; } + /// The number of seconds the server waits for activity on a noninteractive connection before closing it. + public int? WaitTimeout { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Mysql_advanced_config() + { + AdditionalData = new Dictionary(); + LogOutput = global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config_log_output.NONE; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "backup_hour", n => { BackupHour = n.GetIntValue(); } }, + { "backup_minute", n => { BackupMinute = n.GetIntValue(); } }, + { "binlog_retention_period", n => { BinlogRetentionPeriod = n.GetDoubleValue(); } }, + { "connect_timeout", n => { ConnectTimeout = n.GetIntValue(); } }, + { "default_time_zone", n => { DefaultTimeZone = n.GetStringValue(); } }, + { "group_concat_max_len", n => { GroupConcatMaxLen = n.GetIntValue(); } }, + { "information_schema_stats_expiry", n => { InformationSchemaStatsExpiry = n.GetIntValue(); } }, + { "innodb_change_buffer_max_size", n => { InnodbChangeBufferMaxSize = n.GetIntValue(); } }, + { "innodb_flush_neighbors", n => { InnodbFlushNeighbors = n.GetIntValue(); } }, + { "innodb_ft_min_token_size", n => { InnodbFtMinTokenSize = n.GetIntValue(); } }, + { "innodb_ft_server_stopword_table", n => { InnodbFtServerStopwordTable = n.GetStringValue(); } }, + { "innodb_lock_wait_timeout", n => { InnodbLockWaitTimeout = n.GetIntValue(); } }, + { "innodb_log_buffer_size", n => { InnodbLogBufferSize = n.GetIntValue(); } }, + { "innodb_online_alter_log_max_size", n => { InnodbOnlineAlterLogMaxSize = n.GetIntValue(); } }, + { "innodb_print_all_deadlocks", n => { InnodbPrintAllDeadlocks = n.GetBoolValue(); } }, + { "innodb_read_io_threads", n => { InnodbReadIoThreads = n.GetIntValue(); } }, + { "innodb_rollback_on_timeout", n => { InnodbRollbackOnTimeout = n.GetBoolValue(); } }, + { "innodb_thread_concurrency", n => { InnodbThreadConcurrency = n.GetIntValue(); } }, + { "innodb_write_io_threads", n => { InnodbWriteIoThreads = n.GetIntValue(); } }, + { "interactive_timeout", n => { InteractiveTimeout = n.GetIntValue(); } }, + { "internal_tmp_mem_storage_engine", n => { InternalTmpMemStorageEngine = n.GetEnumValue(); } }, + { "log_output", n => { LogOutput = n.GetEnumValue(); } }, + { "long_query_time", n => { LongQueryTime = n.GetDoubleValue(); } }, + { "max_allowed_packet", n => { MaxAllowedPacket = n.GetIntValue(); } }, + { "max_heap_table_size", n => { MaxHeapTableSize = n.GetIntValue(); } }, + { "net_buffer_length", n => { NetBufferLength = n.GetIntValue(); } }, + { "net_read_timeout", n => { NetReadTimeout = n.GetIntValue(); } }, + { "net_write_timeout", n => { NetWriteTimeout = n.GetIntValue(); } }, + { "slow_query_log", n => { SlowQueryLog = n.GetBoolValue(); } }, + { "sort_buffer_size", n => { SortBufferSize = n.GetIntValue(); } }, + { "sql_mode", n => { SqlMode = n.GetStringValue(); } }, + { "sql_require_primary_key", n => { SqlRequirePrimaryKey = n.GetBoolValue(); } }, + { "tmp_table_size", n => { TmpTableSize = n.GetIntValue(); } }, + { "wait_timeout", n => { WaitTimeout = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("backup_hour", BackupHour); + writer.WriteIntValue("backup_minute", BackupMinute); + writer.WriteDoubleValue("binlog_retention_period", BinlogRetentionPeriod); + writer.WriteIntValue("connect_timeout", ConnectTimeout); + writer.WriteStringValue("default_time_zone", DefaultTimeZone); + writer.WriteIntValue("group_concat_max_len", GroupConcatMaxLen); + writer.WriteIntValue("information_schema_stats_expiry", InformationSchemaStatsExpiry); + writer.WriteIntValue("innodb_change_buffer_max_size", InnodbChangeBufferMaxSize); + writer.WriteIntValue("innodb_flush_neighbors", InnodbFlushNeighbors); + writer.WriteIntValue("innodb_ft_min_token_size", InnodbFtMinTokenSize); + writer.WriteStringValue("innodb_ft_server_stopword_table", InnodbFtServerStopwordTable); + writer.WriteIntValue("innodb_lock_wait_timeout", InnodbLockWaitTimeout); + writer.WriteIntValue("innodb_log_buffer_size", InnodbLogBufferSize); + writer.WriteIntValue("innodb_online_alter_log_max_size", InnodbOnlineAlterLogMaxSize); + writer.WriteBoolValue("innodb_print_all_deadlocks", InnodbPrintAllDeadlocks); + writer.WriteIntValue("innodb_read_io_threads", InnodbReadIoThreads); + writer.WriteBoolValue("innodb_rollback_on_timeout", InnodbRollbackOnTimeout); + writer.WriteIntValue("innodb_thread_concurrency", InnodbThreadConcurrency); + writer.WriteIntValue("innodb_write_io_threads", InnodbWriteIoThreads); + writer.WriteIntValue("interactive_timeout", InteractiveTimeout); + writer.WriteEnumValue("internal_tmp_mem_storage_engine", InternalTmpMemStorageEngine); + writer.WriteEnumValue("log_output", LogOutput); + writer.WriteDoubleValue("long_query_time", LongQueryTime); + writer.WriteIntValue("max_allowed_packet", MaxAllowedPacket); + writer.WriteIntValue("max_heap_table_size", MaxHeapTableSize); + writer.WriteIntValue("net_buffer_length", NetBufferLength); + writer.WriteIntValue("net_read_timeout", NetReadTimeout); + writer.WriteIntValue("net_write_timeout", NetWriteTimeout); + writer.WriteBoolValue("slow_query_log", SlowQueryLog); + writer.WriteIntValue("sort_buffer_size", SortBufferSize); + writer.WriteStringValue("sql_mode", SqlMode); + writer.WriteBoolValue("sql_require_primary_key", SqlRequirePrimaryKey); + writer.WriteIntValue("tmp_table_size", TmpTableSize); + writer.WriteIntValue("wait_timeout", WaitTimeout); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config_internal_tmp_mem_storage_engine.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config_internal_tmp_mem_storage_engine.cs new file mode 100644 index 0000000..b223b7d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config_internal_tmp_mem_storage_engine.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The storage engine for in-memory internal temporary tables. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Mysql_advanced_config_internal_tmp_mem_storage_engine + { + [EnumMember(Value = "TempTable")] + #pragma warning disable CS1591 + TempTable, + #pragma warning restore CS1591 + [EnumMember(Value = "MEMORY")] + #pragma warning disable CS1591 + MEMORY, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config_log_output.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config_log_output.cs new file mode 100644 index 0000000..bf51fe0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_advanced_config_log_output.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Defines the destination for logs. Can be `INSIGHTS`, `TABLE`, or both (`INSIGHTS,TABLE`), or `NONE` to disable logs. To specify both destinations, use `INSIGHTS,TABLE` (order matters). Default is NONE. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Mysql_advanced_config_log_output + { + [EnumMember(Value = "INSIGHTS")] + #pragma warning disable CS1591 + INSIGHTS, + #pragma warning restore CS1591 + [EnumMember(Value = "TABLE")] + #pragma warning disable CS1591 + TABLE, + #pragma warning restore CS1591 + [EnumMember(Value = "INSIGHTS,TABLE")] + #pragma warning disable CS1591 + INSIGHTSTABLE, + #pragma warning restore CS1591 + [EnumMember(Value = "NONE")] + #pragma warning disable CS1591 + NONE, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_settings.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_settings.cs new file mode 100644 index 0000000..4f12f16 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_settings.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Mysql_settings : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A string specifying the authentication method to be used for connectionsto the MySQL user account. The valid values are `mysql_native_password`or `caching_sha2_password`. If excluded when creating a new user, thedefault for the version of MySQL in use will be used. As of MySQL 8.0, thedefault is `caching_sha2_password`. + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings_auth_plugin? AuthPlugin { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Mysql_settings() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "auth_plugin", n => { AuthPlugin = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("auth_plugin", AuthPlugin); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_settings_auth_plugin.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_settings_auth_plugin.cs new file mode 100644 index 0000000..d1e9621 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Mysql_settings_auth_plugin.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string specifying the authentication method to be used for connectionsto the MySQL user account. The valid values are `mysql_native_password`or `caching_sha2_password`. If excluded when creating a new user, thedefault for the version of MySQL in use will be used. As of MySQL 8.0, thedefault is `caching_sha2_password`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Mysql_settings_auth_plugin + { + [EnumMember(Value = "mysql_native_password")] + #pragma warning disable CS1591 + Mysql_native_password, + #pragma warning restore CS1591 + [EnumMember(Value = "caching_sha2_password")] + #pragma warning disable CS1591 + Caching_sha2_password, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Namespace_info.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Namespace_info.cs new file mode 100644 index 0000000..faa40b8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Namespace_info.cs @@ -0,0 +1,135 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Namespace_info : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The namespace's API hostname. Each function in a namespace is provided an endpoint at the namespace's hostname. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ApiHost { get; set; } +#nullable restore +#else + public string ApiHost { get; set; } +#endif + /// UTC time string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; set; } +#nullable restore +#else + public string CreatedAt { get; set; } +#endif + /// A random alpha numeric string. This key is used in conjunction with the namespace's UUID to authenticate a user to use the namespace via `doctl`, DigitalOcean's official CLI. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// The namespace's unique name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Label { get; set; } +#nullable restore +#else + public string Label { get; set; } +#endif + /// A unique string format of UUID with a prefix fn-. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Namespace { get; set; } +#nullable restore +#else + public string Namespace { get; set; } +#endif + /// The namespace's datacenter region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// UTC time string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UpdatedAt { get; set; } +#nullable restore +#else + public string UpdatedAt { get; set; } +#endif + /// The namespace's Universally Unique Identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uuid { get; set; } +#nullable restore +#else + public string Uuid { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Namespace_info() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "api_host", n => { ApiHost = n.GetStringValue(); } }, + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "key", n => { Key = n.GetStringValue(); } }, + { "label", n => { Label = n.GetStringValue(); } }, + { "namespace", n => { Namespace = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetStringValue(); } }, + { "uuid", n => { Uuid = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("api_host", ApiHost); + writer.WriteStringValue("created_at", CreatedAt); + writer.WriteStringValue("key", Key); + writer.WriteStringValue("label", Label); + writer.WriteStringValue("namespace", Namespace); + writer.WriteStringValue("region", Region); + writer.WriteStringValue("updated_at", UpdatedAt); + writer.WriteStringValue("uuid", Uuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Neighbor_ids.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Neighbor_ids.cs new file mode 100644 index 0000000..2cb34f6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Neighbor_ids.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Neighbor_ids : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of arrays. Each array will contain a set of Droplet IDs for Droplets that share a physical server. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UntypedNode? NeighborIds { get; set; } +#nullable restore +#else + public UntypedNode NeighborIds { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Neighbor_ids() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Neighbor_ids CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Neighbor_ids(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "neighbor_ids", n => { NeighborIds = n.GetObjectValue(UntypedNode.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("neighbor_ids", NeighborIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Network_v4.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v4.cs new file mode 100644 index 0000000..d3959a5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v4.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Network_v4 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The gateway of the specified IPv4 network interface.For private interfaces, a gateway is not provided. This is denoted byreturning `nil` as its value. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Gateway { get; set; } +#nullable restore +#else + public string Gateway { get; set; } +#endif + /// The IP address of the IPv4 network interface. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IpAddress { get; set; } +#nullable restore +#else + public string IpAddress { get; set; } +#endif + /// The netmask of the IPv4 network interface. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Netmask { get; set; } +#nullable restore +#else + public string Netmask { get; set; } +#endif + /// The type of the IPv4 network interface. + public global::InfinityFlow.DigitalOcean.Client.Models.Network_v4_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Network_v4() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Network_v4 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Network_v4(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "gateway", n => { Gateway = n.GetStringValue(); } }, + { "ip_address", n => { IpAddress = n.GetStringValue(); } }, + { "netmask", n => { Netmask = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("gateway", Gateway); + writer.WriteStringValue("ip_address", IpAddress); + writer.WriteStringValue("netmask", Netmask); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Network_v4_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v4_type.cs new file mode 100644 index 0000000..425916e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v4_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of the IPv4 network interface. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Network_v4_type + { + [EnumMember(Value = "public")] + #pragma warning disable CS1591 + Public, + #pragma warning restore CS1591 + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Network_v6.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v6.cs new file mode 100644 index 0000000..9fd5d90 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v6.cs @@ -0,0 +1,83 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Network_v6 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The gateway of the specified IPv6 network interface. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Gateway { get; set; } +#nullable restore +#else + public string Gateway { get; set; } +#endif + /// The IP address of the IPv6 network interface. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IpAddress { get; set; } +#nullable restore +#else + public string IpAddress { get; set; } +#endif + /// The netmask of the IPv6 network interface. + public int? Netmask { get; set; } + /// The type of the IPv6 network interface.**Note**: IPv6 private networking is not currently supported. + public global::InfinityFlow.DigitalOcean.Client.Models.Network_v6_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Network_v6() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Network_v6 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Network_v6(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "gateway", n => { Gateway = n.GetStringValue(); } }, + { "ip_address", n => { IpAddress = n.GetStringValue(); } }, + { "netmask", n => { Netmask = n.GetIntValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("gateway", Gateway); + writer.WriteStringValue("ip_address", IpAddress); + writer.WriteIntValue("netmask", Netmask); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Network_v6_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v6_type.cs new file mode 100644 index 0000000..a4e20db --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Network_v6_type.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of the IPv6 network interface.**Note**: IPv6 private networking is not currently supported. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Network_v6_type + { + [EnumMember(Value = "public")] + #pragma warning disable CS1591 + Public, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Node.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Node.cs new file mode 100644 index 0000000..5cc2a14 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Node.cs @@ -0,0 +1,97 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Node : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the node was created. + public DateTimeOffset? CreatedAt { get; set; } + /// The ID of the Droplet used for the worker node. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DropletId { get; set; } +#nullable restore +#else + public string DropletId { get; set; } +#endif + /// A unique ID that can be used to identify and reference the node. + public Guid? Id { get; set; } + /// An automatically generated, human-readable name for the node. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An object containing a `state` attribute whose value is set to a string indicating the current status of the node. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Node_status? Status { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Node_status Status { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the node was last updated. + public DateTimeOffset? UpdatedAt { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Node() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Node CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Node(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "droplet_id", n => { DropletId = n.GetStringValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "status", n => { Status = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Node_status.CreateFromDiscriminatorValue); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteStringValue("droplet_id", DropletId); + writer.WriteGuidValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("status", Status); + writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Node_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Node_status.cs new file mode 100644 index 0000000..682f68e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Node_status.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing a `state` attribute whose value is set to a string indicating the current status of the node. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Node_status : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A string indicating the current status of the node. + public global::InfinityFlow.DigitalOcean.Client.Models.Node_status_state? State { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Node_status() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Node_status CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Node_status(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "state", n => { State = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("state", State); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Node_status_state.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Node_status_state.cs new file mode 100644 index 0000000..cb36092 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Node_status_state.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// A string indicating the current status of the node. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Node_status_state + { + [EnumMember(Value = "provisioning")] + #pragma warning disable CS1591 + Provisioning, + #pragma warning restore CS1591 + [EnumMember(Value = "running")] + #pragma warning disable CS1591 + Running, + #pragma warning restore CS1591 + [EnumMember(Value = "draining")] + #pragma warning disable CS1591 + Draining, + #pragma warning restore CS1591 + [EnumMember(Value = "deleting")] + #pragma warning disable CS1591 + Deleting, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Notification.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Notification.cs new file mode 100644 index 0000000..b4e8a4d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Notification.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The notification settings for a trigger alert. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Notification : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An email to notify on an alert trigger. The Email has to be one that is verified on that DigitalOcean account. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Email { get; set; } +#nullable restore +#else + public List Email { get; set; } +#endif + /// Slack integration details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Slack { get; set; } +#nullable restore +#else + public List Slack { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Notification() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Notification CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Notification(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "email", n => { Email = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "slack", n => { Slack = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Notification_slack.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("email", Email); + writer.WriteCollectionOfObjectValues("slack", Slack); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Notification_slack.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Notification_slack.cs new file mode 100644 index 0000000..f8a152f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Notification_slack.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Notification_slack : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Slack channel to notify of an alert trigger. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Channel { get; set; } +#nullable restore +#else + public string Channel { get; set; } +#endif + /// Slack Webhook URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Notification_slack() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Notification_slack CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Notification_slack(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "channel", n => { Channel = n.GetStringValue(); } }, + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("channel", Channel); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/OneClicks.cs b/src/InfinityFlow.DigitalOcean.Client/Models/OneClicks.cs new file mode 100644 index 0000000..847dadf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/OneClicks.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OneClicks : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The slug identifier for the 1-Click application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// The type of the 1-Click application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OneClicks() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.OneClicks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.OneClicks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "slug", n => { Slug = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("slug", Slug); + writer.WriteStringValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/OneClicks_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/OneClicks_create.cs new file mode 100644 index 0000000..e1f64d2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/OneClicks_create.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OneClicks_create : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of 1-Click Application slugs to be installed to the Kubernetes cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AddonSlugs { get; set; } +#nullable restore +#else + public List AddonSlugs { get; set; } +#endif + /// A unique ID for the Kubernetes cluster to which the 1-Click Applications will be installed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterUuid { get; set; } +#nullable restore +#else + public string ClusterUuid { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OneClicks_create() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "addon_slugs", n => { AddonSlugs = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "cluster_uuid", n => { ClusterUuid = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("addon_slugs", AddonSlugs); + writer.WriteStringValue("cluster_uuid", ClusterUuid); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Online_migration.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Online_migration.cs new file mode 100644 index 0000000..684f547 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Online_migration.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Online_migration : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The time the migration was initiated, in ISO 8601 format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; set; } +#nullable restore +#else + public string CreatedAt { get; set; } +#endif + /// The ID of the most recent migration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The current status of the migration. + public global::InfinityFlow.DigitalOcean.Client.Models.Online_migration_status? Status { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Online_migration() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Online_migration CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Online_migration(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("created_at", CreatedAt); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("status", Status); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Online_migration_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Online_migration_status.cs new file mode 100644 index 0000000..38fa2e1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Online_migration_status.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The current status of the migration. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Online_migration_status + { + [EnumMember(Value = "running")] + #pragma warning disable CS1591 + Running, + #pragma warning restore CS1591 + [EnumMember(Value = "canceled")] + #pragma warning disable CS1591 + Canceled, + #pragma warning restore CS1591 + [EnumMember(Value = "error")] + #pragma warning disable CS1591 + Error, + #pragma warning restore CS1591 + [EnumMember(Value = "done")] + #pragma warning disable CS1591 + Done, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_advanced_config.cs new file mode 100644 index 0000000..9a5ada8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_advanced_config.cs @@ -0,0 +1,220 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Opensearch_advanced_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Specifices whether to allow automatic creation of indices. + public bool? ActionAutoCreateIndexEnabled { get; set; } + /// Specifies whether to require explicit index names when deleting indices. + public bool? ActionDestructiveRequiresName { get; set; } + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Maximum number of shards allowed per data node. + public int? ClusterMaxShardsPerNode { get; set; } + /// Maximum concurrent incoming/outgoing shard recoveries (normally replicas) are allowed to happen per node . + public int? ClusterRoutingAllocationNodeConcurrentRecoveries { get; set; } + /// Specifies whether to allow security audit logging. + public bool? EnableSecurityAudit { get; set; } + /// Maximum content length for HTTP requests to the OpenSearch HTTP API, in bytes. + public int? HttpMaxContentLengthBytes { get; set; } + /// Maximum size of allowed headers, in bytes. + public int? HttpMaxHeaderSizeBytes { get; set; } + /// Maximum length of an HTTP URL, in bytes. + public int? HttpMaxInitialLineLengthBytes { get; set; } + /// Maximum amount of heap memory used for field data cache, expressed as a percentage. Decreasing the value too much will increase overhead of loading field data. Increasing the value too much will decrease amount of heap available for other operations. + public int? IndicesFielddataCacheSizePercentage { get; set; } + /// Total amount of heap used for indexing buffer before writing segments to disk, expressed as a percentage. Too low value will slow down indexing; too high value will increase indexing performance but causes performance issues for query performance. + public int? IndicesMemoryIndexBufferSizePercentage { get; set; } + /// Maximum amount of heap used for indexing buffer before writing segments to disk, in mb. Works in conjunction with indices_memory_index_buffer_size_percentage, each being enforced. The default is unbounded. + public int? IndicesMemoryMaxIndexBufferSizeMb { get; set; } + /// Minimum amount of heap used for indexing buffer before writing segments to disk, in mb. Works in conjunction with indices_memory_index_buffer_size_percentage, each being enforced. + public int? IndicesMemoryMinIndexBufferSizeMb { get; set; } + /// Maximum amount of heap used for query cache. Too low value will decrease query performance and increase performance for other operations; too high value will cause issues with other functionality. + public int? IndicesQueriesCacheSizePercentage { get; set; } + /// Maximum number of clauses Lucene BooleanQuery can have. Only increase it if necessary, as it may cause performance issues. + public int? IndicesQueryBoolMaxClauseCount { get; set; } + /// Maximum number of file chunks sent in parallel for each recovery. + public int? IndicesRecoveryMaxConcurrentFileChunks { get; set; } + /// Limits total inbound and outbound recovery traffic for each node, expressed in mb per second. Applies to both peer recoveries as well as snapshot recoveries (i.e., restores from a snapshot). + public int? IndicesRecoveryMaxMbPerSec { get; set; } + /// Specifies whether ISM is enabled or not. + public bool? IsmEnabled { get; set; } + /// Specifies whether audit history is enabled or not. The logs from ISM are automatically indexed to a logs document. + public bool? IsmHistoryEnabled { get; set; } + /// Maximum age before rolling over the audit history index, in hours. + public int? IsmHistoryMaxAgeHours { get; set; } + /// Maximum number of documents before rolling over the audit history index. + public int? IsmHistoryMaxDocs { get; set; } + /// The time between rollover checks for the audit history index, in hours. + public int? IsmHistoryRolloverCheckPeriodHours { get; set; } + /// Length of time long audit history indices are kept, in days. + public int? IsmHistoryRolloverRetentionPeriodDays { get; set; } + /// Compatibility mode sets OpenSearch to report its version as 7.10 so clients continue to work. + public bool? OverrideMainResponseVersion { get; set; } + /// Enable or disable filtering of alerting by backend roles. + public bool? PluginsAlertingFilterByBackendRolesEnabled { get; set; } + /// Allowlist of remote IP addresses for reindexing. Changing this value will cause all OpenSearch instances to restart. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ReindexRemoteWhitelist { get; set; } +#nullable restore +#else + public List ReindexRemoteWhitelist { get; set; } +#endif + /// Limits the number of inline script compilations within a period of time. Default is use-context +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ScriptMaxCompilationsRate { get; set; } +#nullable restore +#else + public string ScriptMaxCompilationsRate { get; set; } +#endif + /// Maximum number of aggregation buckets allowed in a single response. + public int? SearchMaxBuckets { get; set; } + /// Size of queue for operations in the analyze thread pool. + public int? ThreadPoolAnalyzeQueueSize { get; set; } + /// Number of workers in the analyze operation thread pool. Do note this may have maximum value depending on CPU count - value is automatically lowered if set to higher than maximum value. + public int? ThreadPoolAnalyzeSize { get; set; } + /// Number of workers in the force merge operation thread pool. This pool is used for forcing a merge between shards of one or more indices. Do note this may have maximum value depending on CPU count - value is automatically lowered if set to higher than maximum value. + public int? ThreadPoolForceMergeSize { get; set; } + /// Size of queue for operations in the get thread pool. + public int? ThreadPoolGetQueueSize { get; set; } + /// Number of workers in the get operation thread pool. Do note this may have maximum value depending on CPU count - value is automatically lowered if set to higher than maximum value. + public int? ThreadPoolGetSize { get; set; } + /// Size of queue for operations in the search thread pool. + public int? ThreadPoolSearchQueueSize { get; set; } + /// Number of workers in the search operation thread pool. Do note this may have maximum value depending on CPU count - value is automatically lowered if set to higher than maximum value. + public int? ThreadPoolSearchSize { get; set; } + /// Size of queue for operations in the search throttled thread pool. + public int? ThreadPoolSearchThrottledQueueSize { get; set; } + /// Number of workers in the search throttled operation thread pool. This pool is used for searching frozen indices. Do note this may have maximum value depending on CPU count - value is automatically lowered if set to higher than maximum value. + public int? ThreadPoolSearchThrottledSize { get; set; } + /// Size of queue for operations in the write thread pool. + public int? ThreadPoolWriteQueueSize { get; set; } + /// Number of workers in the write operation thread pool. Do note this may have maximum value depending on CPU count - value is automatically lowered if set to higher than maximum value. + public int? ThreadPoolWriteSize { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_advanced_config() + { + AdditionalData = new Dictionary(); + ScriptMaxCompilationsRate = "use-context"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action_auto_create_index_enabled", n => { ActionAutoCreateIndexEnabled = n.GetBoolValue(); } }, + { "action_destructive_requires_name", n => { ActionDestructiveRequiresName = n.GetBoolValue(); } }, + { "cluster_max_shards_per_node", n => { ClusterMaxShardsPerNode = n.GetIntValue(); } }, + { "cluster_routing_allocation_node_concurrent_recoveries", n => { ClusterRoutingAllocationNodeConcurrentRecoveries = n.GetIntValue(); } }, + { "enable_security_audit", n => { EnableSecurityAudit = n.GetBoolValue(); } }, + { "http_max_content_length_bytes", n => { HttpMaxContentLengthBytes = n.GetIntValue(); } }, + { "http_max_header_size_bytes", n => { HttpMaxHeaderSizeBytes = n.GetIntValue(); } }, + { "http_max_initial_line_length_bytes", n => { HttpMaxInitialLineLengthBytes = n.GetIntValue(); } }, + { "indices_fielddata_cache_size_percentage", n => { IndicesFielddataCacheSizePercentage = n.GetIntValue(); } }, + { "indices_memory_index_buffer_size_percentage", n => { IndicesMemoryIndexBufferSizePercentage = n.GetIntValue(); } }, + { "indices_memory_max_index_buffer_size_mb", n => { IndicesMemoryMaxIndexBufferSizeMb = n.GetIntValue(); } }, + { "indices_memory_min_index_buffer_size_mb", n => { IndicesMemoryMinIndexBufferSizeMb = n.GetIntValue(); } }, + { "indices_queries_cache_size_percentage", n => { IndicesQueriesCacheSizePercentage = n.GetIntValue(); } }, + { "indices_query_bool_max_clause_count", n => { IndicesQueryBoolMaxClauseCount = n.GetIntValue(); } }, + { "indices_recovery_max_concurrent_file_chunks", n => { IndicesRecoveryMaxConcurrentFileChunks = n.GetIntValue(); } }, + { "indices_recovery_max_mb_per_sec", n => { IndicesRecoveryMaxMbPerSec = n.GetIntValue(); } }, + { "ism_enabled", n => { IsmEnabled = n.GetBoolValue(); } }, + { "ism_history_enabled", n => { IsmHistoryEnabled = n.GetBoolValue(); } }, + { "ism_history_max_age_hours", n => { IsmHistoryMaxAgeHours = n.GetIntValue(); } }, + { "ism_history_max_docs", n => { IsmHistoryMaxDocs = n.GetIntValue(); } }, + { "ism_history_rollover_check_period_hours", n => { IsmHistoryRolloverCheckPeriodHours = n.GetIntValue(); } }, + { "ism_history_rollover_retention_period_days", n => { IsmHistoryRolloverRetentionPeriodDays = n.GetIntValue(); } }, + { "override_main_response_version", n => { OverrideMainResponseVersion = n.GetBoolValue(); } }, + { "plugins_alerting_filter_by_backend_roles_enabled", n => { PluginsAlertingFilterByBackendRolesEnabled = n.GetBoolValue(); } }, + { "reindex_remote_whitelist", n => { ReindexRemoteWhitelist = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "script_max_compilations_rate", n => { ScriptMaxCompilationsRate = n.GetStringValue(); } }, + { "search_max_buckets", n => { SearchMaxBuckets = n.GetIntValue(); } }, + { "thread_pool_analyze_queue_size", n => { ThreadPoolAnalyzeQueueSize = n.GetIntValue(); } }, + { "thread_pool_analyze_size", n => { ThreadPoolAnalyzeSize = n.GetIntValue(); } }, + { "thread_pool_force_merge_size", n => { ThreadPoolForceMergeSize = n.GetIntValue(); } }, + { "thread_pool_get_queue_size", n => { ThreadPoolGetQueueSize = n.GetIntValue(); } }, + { "thread_pool_get_size", n => { ThreadPoolGetSize = n.GetIntValue(); } }, + { "thread_pool_search_queue_size", n => { ThreadPoolSearchQueueSize = n.GetIntValue(); } }, + { "thread_pool_search_size", n => { ThreadPoolSearchSize = n.GetIntValue(); } }, + { "thread_pool_search_throttled_queue_size", n => { ThreadPoolSearchThrottledQueueSize = n.GetIntValue(); } }, + { "thread_pool_search_throttled_size", n => { ThreadPoolSearchThrottledSize = n.GetIntValue(); } }, + { "thread_pool_write_queue_size", n => { ThreadPoolWriteQueueSize = n.GetIntValue(); } }, + { "thread_pool_write_size", n => { ThreadPoolWriteSize = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("action_auto_create_index_enabled", ActionAutoCreateIndexEnabled); + writer.WriteBoolValue("action_destructive_requires_name", ActionDestructiveRequiresName); + writer.WriteIntValue("cluster_max_shards_per_node", ClusterMaxShardsPerNode); + writer.WriteIntValue("cluster_routing_allocation_node_concurrent_recoveries", ClusterRoutingAllocationNodeConcurrentRecoveries); + writer.WriteBoolValue("enable_security_audit", EnableSecurityAudit); + writer.WriteIntValue("http_max_content_length_bytes", HttpMaxContentLengthBytes); + writer.WriteIntValue("http_max_header_size_bytes", HttpMaxHeaderSizeBytes); + writer.WriteIntValue("http_max_initial_line_length_bytes", HttpMaxInitialLineLengthBytes); + writer.WriteIntValue("indices_fielddata_cache_size_percentage", IndicesFielddataCacheSizePercentage); + writer.WriteIntValue("indices_memory_index_buffer_size_percentage", IndicesMemoryIndexBufferSizePercentage); + writer.WriteIntValue("indices_memory_max_index_buffer_size_mb", IndicesMemoryMaxIndexBufferSizeMb); + writer.WriteIntValue("indices_memory_min_index_buffer_size_mb", IndicesMemoryMinIndexBufferSizeMb); + writer.WriteIntValue("indices_queries_cache_size_percentage", IndicesQueriesCacheSizePercentage); + writer.WriteIntValue("indices_query_bool_max_clause_count", IndicesQueryBoolMaxClauseCount); + writer.WriteIntValue("indices_recovery_max_concurrent_file_chunks", IndicesRecoveryMaxConcurrentFileChunks); + writer.WriteIntValue("indices_recovery_max_mb_per_sec", IndicesRecoveryMaxMbPerSec); + writer.WriteBoolValue("ism_enabled", IsmEnabled); + writer.WriteBoolValue("ism_history_enabled", IsmHistoryEnabled); + writer.WriteIntValue("ism_history_max_age_hours", IsmHistoryMaxAgeHours); + writer.WriteIntValue("ism_history_max_docs", IsmHistoryMaxDocs); + writer.WriteIntValue("ism_history_rollover_check_period_hours", IsmHistoryRolloverCheckPeriodHours); + writer.WriteIntValue("ism_history_rollover_retention_period_days", IsmHistoryRolloverRetentionPeriodDays); + writer.WriteBoolValue("override_main_response_version", OverrideMainResponseVersion); + writer.WriteBoolValue("plugins_alerting_filter_by_backend_roles_enabled", PluginsAlertingFilterByBackendRolesEnabled); + writer.WriteCollectionOfPrimitiveValues("reindex_remote_whitelist", ReindexRemoteWhitelist); + writer.WriteStringValue("script_max_compilations_rate", ScriptMaxCompilationsRate); + writer.WriteIntValue("search_max_buckets", SearchMaxBuckets); + writer.WriteIntValue("thread_pool_analyze_queue_size", ThreadPoolAnalyzeQueueSize); + writer.WriteIntValue("thread_pool_analyze_size", ThreadPoolAnalyzeSize); + writer.WriteIntValue("thread_pool_force_merge_size", ThreadPoolForceMergeSize); + writer.WriteIntValue("thread_pool_get_queue_size", ThreadPoolGetQueueSize); + writer.WriteIntValue("thread_pool_get_size", ThreadPoolGetSize); + writer.WriteIntValue("thread_pool_search_queue_size", ThreadPoolSearchQueueSize); + writer.WriteIntValue("thread_pool_search_size", ThreadPoolSearchSize); + writer.WriteIntValue("thread_pool_search_throttled_queue_size", ThreadPoolSearchThrottledQueueSize); + writer.WriteIntValue("thread_pool_search_throttled_size", ThreadPoolSearchThrottledSize); + writer.WriteIntValue("thread_pool_write_queue_size", ThreadPoolWriteQueueSize); + writer.WriteIntValue("thread_pool_write_size", ThreadPoolWriteSize); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config.cs new file mode 100644 index 0000000..4361cd8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config.cs @@ -0,0 +1,119 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Opensearch_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Name of a managed OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterName { get; set; } +#nullable restore +#else + public string ClusterName { get; set; } +#endif + /// A unique identifier for a managed OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterUuid { get; set; } +#nullable restore +#else + public string ClusterUuid { get; set; } +#endif + /// Credentials for an OpenSearch cluster user. Optional if `cluster_uuid` is passed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_credentials? Credentials { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_credentials Credentials { get; set; } +#endif + /// host of the OpenSearch cluster +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; set; } +#nullable restore +#else + public string Endpoint { get; set; } +#endif + /// A unique identifier for a configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// OpenSearch index to send logs to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexName { get; set; } +#nullable restore +#else + public string IndexName { get; set; } +#endif + /// Number of days to retain logs in OpenSearch (default: 14) + public int? RetentionDays { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_config() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cluster_name", n => { ClusterName = n.GetStringValue(); } }, + { "cluster_uuid", n => { ClusterUuid = n.GetStringValue(); } }, + { "credentials", n => { Credentials = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_credentials.CreateFromDiscriminatorValue); } }, + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "index_name", n => { IndexName = n.GetStringValue(); } }, + { "retention_days", n => { RetentionDays = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cluster_name", ClusterName); + writer.WriteStringValue("cluster_uuid", ClusterUuid); + writer.WriteObjectValue("credentials", Credentials); + writer.WriteStringValue("endpoint", Endpoint); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("index_name", IndexName); + writer.WriteIntValue("retention_days", RetentionDays); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_credentials.cs new file mode 100644 index 0000000..e3d1692 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_credentials.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Credentials for an OpenSearch cluster user. Optional if `cluster_uuid` is passed. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Opensearch_config_credentials : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The password property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// The username property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_config_credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "password", n => { Password = n.GetStringValue(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("password", Password); + writer.WriteStringValue("username", Username); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_omit_credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_omit_credentials.cs new file mode 100644 index 0000000..8cfcf6b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_omit_credentials.cs @@ -0,0 +1,110 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// OpenSearch destination configuration with `credentials` omitted. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Opensearch_config_omit_credentials : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Name of a managed OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterName { get; set; } +#nullable restore +#else + public string ClusterName { get; set; } +#endif + /// A unique identifier for a managed OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterUuid { get; set; } +#nullable restore +#else + public string ClusterUuid { get; set; } +#endif + /// host of the OpenSearch cluster +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; set; } +#nullable restore +#else + public string Endpoint { get; set; } +#endif + /// A unique identifier for a configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// OpenSearch index to send logs to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexName { get; set; } +#nullable restore +#else + public string IndexName { get; set; } +#endif + /// Number of days to retain logs in OpenSearch. + public int? RetentionDays { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_config_omit_credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_omit_credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_omit_credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cluster_name", n => { ClusterName = n.GetStringValue(); } }, + { "cluster_uuid", n => { ClusterUuid = n.GetStringValue(); } }, + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "index_name", n => { IndexName = n.GetStringValue(); } }, + { "retention_days", n => { RetentionDays = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cluster_name", ClusterName); + writer.WriteStringValue("cluster_uuid", ClusterUuid); + writer.WriteStringValue("endpoint", Endpoint); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("index_name", IndexName); + writer.WriteIntValue("retention_days", RetentionDays); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_request.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_request.cs new file mode 100644 index 0000000..bfc3969 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_request.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Opensearch_config_request : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Name of a managed OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterName { get; set; } +#nullable restore +#else + public string ClusterName { get; set; } +#endif + /// A unique identifier for a managed OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClusterUuid { get; set; } +#nullable restore +#else + public string ClusterUuid { get; set; } +#endif + /// Credentials for an OpenSearch cluster user. Optional if `cluster_uuid` is passed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request_credentials? Credentials { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request_credentials Credentials { get; set; } +#endif + /// host of the OpenSearch cluster +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Endpoint { get; set; } +#nullable restore +#else + public string Endpoint { get; set; } +#endif + /// OpenSearch index to send logs to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexName { get; set; } +#nullable restore +#else + public string IndexName { get; set; } +#endif + /// Number of days to retain logs in an OpenSearch cluster. + public int? RetentionDays { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_config_request() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cluster_name", n => { ClusterName = n.GetStringValue(); } }, + { "cluster_uuid", n => { ClusterUuid = n.GetStringValue(); } }, + { "credentials", n => { Credentials = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request_credentials.CreateFromDiscriminatorValue); } }, + { "endpoint", n => { Endpoint = n.GetStringValue(); } }, + { "index_name", n => { IndexName = n.GetStringValue(); } }, + { "retention_days", n => { RetentionDays = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cluster_name", ClusterName); + writer.WriteStringValue("cluster_uuid", ClusterUuid); + writer.WriteObjectValue("credentials", Credentials); + writer.WriteStringValue("endpoint", Endpoint); + writer.WriteStringValue("index_name", IndexName); + writer.WriteIntValue("retention_days", RetentionDays); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_request_credentials.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_request_credentials.cs new file mode 100644 index 0000000..5ecd757 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_config_request_credentials.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Credentials for an OpenSearch cluster user. Optional if `cluster_uuid` is passed. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Opensearch_config_request_credentials : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The password property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// The username property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_config_request_credentials() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request_credentials CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_config_request_credentials(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "password", n => { Password = n.GetStringValue(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("password", Password); + writer.WriteStringValue("username", Username); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_connection.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_connection.cs new file mode 100644 index 0000000..dce7932 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_connection.cs @@ -0,0 +1,97 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Opensearch_connection : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The FQDN pointing to the opensearch cluster's current primary node. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Host { get; private set; } +#nullable restore +#else + public string Host { get; private set; } +#endif + /// The randomly generated password for the default user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; private set; } +#nullable restore +#else + public string Password { get; private set; } +#endif + /// The port on which the opensearch dashboard is listening. + public int? Port { get; private set; } + /// A boolean value indicating if the connection should be made over SSL. + public bool? Ssl { get; private set; } + /// This is provided as a convenience and should be able to be constructed by the other attributes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Uri { get; private set; } +#nullable restore +#else + public string Uri { get; private set; } +#endif + /// The default user for the opensearch dashboard. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; private set; } +#nullable restore +#else + public string User { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_connection() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_connection CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_connection(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "host", n => { Host = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "port", n => { Port = n.GetIntValue(); } }, + { "ssl", n => { Ssl = n.GetBoolValue(); } }, + { "uri", n => { Uri = n.GetStringValue(); } }, + { "user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index.cs new file mode 100644 index 0000000..4a85df1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index.cs @@ -0,0 +1,54 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Opensearch_index : global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index_base, IParsable + #pragma warning restore CS1591 + { + /// The health of the OpenSearch index. + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index_health? Health { get; set; } + /// The status of the OpenSearch index. + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index_status? Status { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "health", n => { Health = n.GetEnumValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("health", Health); + writer.WriteEnumValue("status", Status); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_base.cs new file mode 100644 index 0000000..0f10769 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_base.cs @@ -0,0 +1,81 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Opensearch_index_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The date and time the index was created. + public DateTimeOffset? CreatedTime { get; set; } + /// The name of the opensearch index. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexName { get; set; } +#nullable restore +#else + public string IndexName { get; set; } +#endif + /// The number of replicas for the index. + public int? NumberOfReplicas { get; set; } + /// The number of shards for the index. + public int? NumberOfShards { get; set; } + /// The size of the index. + public int? Size { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_index_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_time", n => { CreatedTime = n.GetDateTimeOffsetValue(); } }, + { "index_name", n => { IndexName = n.GetStringValue(); } }, + { "number_of_replicas", n => { NumberOfReplicas = n.GetIntValue(); } }, + { "number_of_shards", n => { NumberOfShards = n.GetIntValue(); } }, + { "size", n => { Size = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("created_time", CreatedTime); + writer.WriteStringValue("index_name", IndexName); + writer.WriteIntValue("number_of_replicas", NumberOfReplicas); + writer.WriteIntValue("number_of_shards", NumberOfShards); + writer.WriteIntValue("size", Size); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_health.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_health.cs new file mode 100644 index 0000000..16808c2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_health.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The health of the OpenSearch index. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Opensearch_index_health + { + [EnumMember(Value = "unknown")] + #pragma warning disable CS1591 + Unknown, + #pragma warning restore CS1591 + [EnumMember(Value = "green")] + #pragma warning disable CS1591 + Green, + #pragma warning restore CS1591 + [EnumMember(Value = "yellow")] + #pragma warning disable CS1591 + Yellow, + #pragma warning restore CS1591 + [EnumMember(Value = "red")] + #pragma warning disable CS1591 + Red, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_status.cs new file mode 100644 index 0000000..769e76c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_index_status.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The status of the OpenSearch index. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Opensearch_index_status + { + [EnumMember(Value = "unknown")] + #pragma warning disable CS1591 + Unknown, + #pragma warning restore CS1591 + [EnumMember(Value = "open")] + #pragma warning disable CS1591 + Open, + #pragma warning restore CS1591 + [EnumMember(Value = "close")] + #pragma warning disable CS1591 + Close, + #pragma warning restore CS1591 + [EnumMember(Value = "none")] + #pragma warning disable CS1591 + None, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_logsink.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_logsink.cs new file mode 100644 index 0000000..118b433 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Opensearch_logsink.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Opensearch_logsink : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// PEM encoded CA certificate +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ca { get; set; } +#nullable restore +#else + public string Ca { get; set; } +#endif + /// Maximum number of days of logs to keep + public int? IndexDaysMax { get; set; } + /// Opensearch index prefix +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexPrefix { get; set; } +#nullable restore +#else + public string IndexPrefix { get; set; } +#endif + /// Opensearch request timeout limit + public float? Timeout { get; set; } + /// Opensearch connection URL +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Opensearch_logsink() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_logsink(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ca", n => { Ca = n.GetStringValue(); } }, + { "index_days_max", n => { IndexDaysMax = n.GetIntValue(); } }, + { "index_prefix", n => { IndexPrefix = n.GetStringValue(); } }, + { "timeout", n => { Timeout = n.GetFloatValue(); } }, + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("ca", Ca); + writer.WriteIntValue("index_days_max", IndexDaysMax); + writer.WriteStringValue("index_prefix", IndexPrefix); + writer.WriteFloatValue("timeout", Timeout); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options.cs new file mode 100644 index 0000000..eb14c36 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The options property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options? OptionsProp { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options OptionsProp { get; set; } +#endif + /// The version_availability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_version_availability? VersionAvailability { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_version_availability VersionAvailability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "options", n => { OptionsProp = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_options.CreateFromDiscriminatorValue); } }, + { "version_availability", n => { VersionAvailability = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_version_availability.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("options", OptionsProp); + writer.WriteObjectValue("version_availability", VersionAvailability); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_options.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options.cs new file mode 100644 index 0000000..93bce4b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_options : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kafka property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_kafka? Kafka { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_kafka Kafka { get; set; } +#endif + /// The mongodb property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mongodb? Mongodb { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mongodb Mongodb { get; set; } +#endif + /// The mysql property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mysql? Mysql { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mysql Mysql { get; set; } +#endif + /// The opensearch property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_opensearch? Opensearch { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_opensearch Opensearch { get; set; } +#endif + /// The pg property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_pg? Pg { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_pg Pg { get; set; } +#endif + /// The redis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_redis? Redis { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Options_options_redis Redis { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kafka", n => { Kafka = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_options_kafka.CreateFromDiscriminatorValue); } }, + { "mongodb", n => { Mongodb = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mongodb.CreateFromDiscriminatorValue); } }, + { "mysql", n => { Mysql = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mysql.CreateFromDiscriminatorValue); } }, + { "opensearch", n => { Opensearch = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_options_opensearch.CreateFromDiscriminatorValue); } }, + { "pg", n => { Pg = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_options_pg.CreateFromDiscriminatorValue); } }, + { "redis", n => { Redis = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Options_options_redis.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("kafka", Kafka); + writer.WriteObjectValue("mongodb", Mongodb); + writer.WriteObjectValue("mysql", Mysql); + writer.WriteObjectValue("opensearch", Opensearch); + writer.WriteObjectValue("pg", Pg); + writer.WriteObjectValue("redis", Redis); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_kafka.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_kafka.cs new file mode 100644 index 0000000..d603f1d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_kafka.cs @@ -0,0 +1,82 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_options_kafka : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects, each indicating the node sizes (otherwise referred to as slugs) that are available with various numbers of nodes in the database cluster. Each slugs denotes the node's identifier, CPU, and RAM (in that order). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Layouts { get; private set; } +#nullable restore +#else + public List Layouts { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; private set; } +#nullable restore +#else + public List Regions { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; private set; } +#nullable restore +#else + public List Versions { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_options_kafka() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_options_kafka CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_options_kafka(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "layouts", n => { Layouts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option.CreateFromDiscriminatorValue)?.AsList(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "versions", n => { Versions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_mongodb.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_mongodb.cs new file mode 100644 index 0000000..ee81180 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_mongodb.cs @@ -0,0 +1,82 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_options_mongodb : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects, each indicating the node sizes (otherwise referred to as slugs) that are available with various numbers of nodes in the database cluster. Each slugs denotes the node's identifier, CPU, and RAM (in that order). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Layouts { get; private set; } +#nullable restore +#else + public List Layouts { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; private set; } +#nullable restore +#else + public List Regions { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; private set; } +#nullable restore +#else + public List Versions { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_options_mongodb() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mongodb CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mongodb(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "layouts", n => { Layouts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option.CreateFromDiscriminatorValue)?.AsList(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "versions", n => { Versions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_mysql.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_mysql.cs new file mode 100644 index 0000000..c956a32 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_mysql.cs @@ -0,0 +1,82 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_options_mysql : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects, each indicating the node sizes (otherwise referred to as slugs) that are available with various numbers of nodes in the database cluster. Each slugs denotes the node's identifier, CPU, and RAM (in that order). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Layouts { get; private set; } +#nullable restore +#else + public List Layouts { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; private set; } +#nullable restore +#else + public List Regions { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; private set; } +#nullable restore +#else + public List Versions { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_options_mysql() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mysql CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_options_mysql(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "layouts", n => { Layouts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option.CreateFromDiscriminatorValue)?.AsList(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "versions", n => { Versions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_opensearch.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_opensearch.cs new file mode 100644 index 0000000..9201988 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_opensearch.cs @@ -0,0 +1,82 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_options_opensearch : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects, each indicating the node sizes (otherwise referred to as slugs) that are available with various numbers of nodes in the database cluster. Each slugs denotes the node's identifier, CPU, and RAM (in that order). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Layouts { get; private set; } +#nullable restore +#else + public List Layouts { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; private set; } +#nullable restore +#else + public List Regions { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; private set; } +#nullable restore +#else + public List Versions { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_options_opensearch() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_options_opensearch CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_options_opensearch(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "layouts", n => { Layouts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option.CreateFromDiscriminatorValue)?.AsList(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "versions", n => { Versions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_pg.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_pg.cs new file mode 100644 index 0000000..8133140 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_pg.cs @@ -0,0 +1,82 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_options_pg : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects, each indicating the node sizes (otherwise referred to as slugs) that are available with various numbers of nodes in the database cluster. Each slugs denotes the node's identifier, CPU, and RAM (in that order). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Layouts { get; private set; } +#nullable restore +#else + public List Layouts { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; private set; } +#nullable restore +#else + public List Regions { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; private set; } +#nullable restore +#else + public List Versions { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_options_pg() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_options_pg CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_options_pg(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "layouts", n => { Layouts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option.CreateFromDiscriminatorValue)?.AsList(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "versions", n => { Versions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_redis.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_redis.cs new file mode 100644 index 0000000..55c9ba6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_options_redis.cs @@ -0,0 +1,82 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_options_redis : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects, each indicating the node sizes (otherwise referred to as slugs) that are available with various numbers of nodes in the database cluster. Each slugs denotes the node's identifier, CPU, and RAM (in that order). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Layouts { get; private set; } +#nullable restore +#else + public List Layouts { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; private set; } +#nullable restore +#else + public List Regions { get; private set; } +#endif + /// An array of strings containing the names of available regions +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; private set; } +#nullable restore +#else + public List Versions { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_options_redis() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_options_redis CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_options_redis(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "layouts", n => { Layouts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_layout_option.CreateFromDiscriminatorValue)?.AsList(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "versions", n => { Versions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Options_version_availability.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Options_version_availability.cs new file mode 100644 index 0000000..39a9fbd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Options_version_availability.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Options_version_availability : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects, each indicating the version end-of-life, end-of-availability for various database engines +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Kafka { get; set; } +#nullable restore +#else + public List Kafka { get; set; } +#endif + /// An array of objects, each indicating the version end-of-life, end-of-availability for various database engines +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Mongodb { get; set; } +#nullable restore +#else + public List Mongodb { get; set; } +#endif + /// An array of objects, each indicating the version end-of-life, end-of-availability for various database engines +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Mysql { get; set; } +#nullable restore +#else + public List Mysql { get; set; } +#endif + /// An array of objects, each indicating the version end-of-life, end-of-availability for various database engines +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Opensearch { get; set; } +#nullable restore +#else + public List Opensearch { get; set; } +#endif + /// An array of objects, each indicating the version end-of-life, end-of-availability for various database engines +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Pg { get; set; } +#nullable restore +#else + public List Pg { get; set; } +#endif + /// An array of objects, each indicating the version end-of-life, end-of-availability for various database engines +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Redis { get; set; } +#nullable restore +#else + public List Redis { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Options_version_availability() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Options_version_availability CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Options_version_availability(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kafka", n => { Kafka = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability.CreateFromDiscriminatorValue)?.AsList(); } }, + { "mongodb", n => { Mongodb = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability.CreateFromDiscriminatorValue)?.AsList(); } }, + { "mysql", n => { Mysql = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability.CreateFromDiscriminatorValue)?.AsList(); } }, + { "opensearch", n => { Opensearch = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability.CreateFromDiscriminatorValue)?.AsList(); } }, + { "pg", n => { Pg = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability.CreateFromDiscriminatorValue)?.AsList(); } }, + { "redis", n => { Redis = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_version_availability.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("kafka", Kafka); + writer.WriteCollectionOfObjectValues("mongodb", Mongodb); + writer.WriteCollectionOfObjectValues("mysql", Mysql); + writer.WriteCollectionOfObjectValues("opensearch", Opensearch); + writer.WriteCollectionOfObjectValues("pg", Pg); + writer.WriteCollectionOfObjectValues("redis", Redis); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Page_links.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Page_links.cs new file mode 100644 index 0000000..0da35d4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Page_links.cs @@ -0,0 +1,131 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Page_links : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The pages property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links.Page_links_pages? Pages { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links.Page_links_pages Pages { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Page_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Page_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Page_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "pages", n => { Pages = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.Page_links_pages.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("pages", Pages); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Page_links_pages : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Backward_links? BackwardLinks { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Backward_links BackwardLinks { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Forward_links? ForwardLinks { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Forward_links ForwardLinks { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links_pagesMember1? PageLinksPagesMember1 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links_pagesMember1 PageLinksPagesMember1 { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Page_links.Page_links_pages CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Page_links.Page_links_pages(); + result.BackwardLinks = new global::InfinityFlow.DigitalOcean.Client.Models.Backward_links(); + result.ForwardLinks = new global::InfinityFlow.DigitalOcean.Client.Models.Forward_links(); + result.PageLinksPagesMember1 = new global::InfinityFlow.DigitalOcean.Client.Models.Page_links_pagesMember1(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(BackwardLinks != null || ForwardLinks != null || PageLinksPagesMember1 != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(BackwardLinks, ForwardLinks, PageLinksPagesMember1); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, BackwardLinks, ForwardLinks, PageLinksPagesMember1); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Page_links_pagesMember1.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Page_links_pagesMember1.cs new file mode 100644 index 0000000..ae242e0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Page_links_pagesMember1.cs @@ -0,0 +1,55 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Page_links_pagesMember1 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Page_links_pagesMember1() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Page_links_pagesMember1 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Page_links_pagesMember1(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config.cs new file mode 100644 index 0000000..1360973 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config.cs @@ -0,0 +1,98 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// PGBouncer connection pooling settings + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Pgbouncer_advanced_config : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// If the automatically-created database pools have been unused this many seconds, they are freed. If 0, timeout is disabled. + public int? AutodbIdleTimeout { get; set; } + /// Only allows a maximum this many server connections per database (regardless of user). If 0, allows unlimited connections. + public int? AutodbMaxDbConnections { get; set; } + /// PGBouncer pool mode + public global::InfinityFlow.DigitalOcean.Client.Models.Pgbouncer_advanced_config_autodb_pool_mode? AutodbPoolMode { get; set; } + /// If non-zero, automatically creates a pool of that size per user when a pool doesn't exist. + public int? AutodbPoolSize { get; set; } + /// List of parameters to ignore when given in startup packet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? IgnoreStartupParameters { get; set; } +#nullable restore +#else + public List IgnoreStartupParameters { get; set; } +#endif + /// If current server connections are below this number, adds more. Improves behavior when usual load comes suddenly back after period of total inactivity. The value is effectively capped at the pool size. + public int? MinPoolSize { get; set; } + /// Drops server connections if they have been idle more than this many seconds. If 0, timeout is disabled. + public int? ServerIdleTimeout { get; set; } + /// The pooler closes any unused server connection that has been connected longer than this amount of seconds. + public int? ServerLifetime { get; set; } + /// Run server_reset_query (DISCARD ALL) in all pooling modes. + public bool? ServerResetQueryAlways { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Pgbouncer_advanced_config() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Pgbouncer_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Pgbouncer_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "autodb_idle_timeout", n => { AutodbIdleTimeout = n.GetIntValue(); } }, + { "autodb_max_db_connections", n => { AutodbMaxDbConnections = n.GetIntValue(); } }, + { "autodb_pool_mode", n => { AutodbPoolMode = n.GetEnumValue(); } }, + { "autodb_pool_size", n => { AutodbPoolSize = n.GetIntValue(); } }, + { "ignore_startup_parameters", n => { IgnoreStartupParameters = n.GetCollectionOfEnumValues()?.AsList(); } }, + { "min_pool_size", n => { MinPoolSize = n.GetIntValue(); } }, + { "server_idle_timeout", n => { ServerIdleTimeout = n.GetIntValue(); } }, + { "server_lifetime", n => { ServerLifetime = n.GetIntValue(); } }, + { "server_reset_query_always", n => { ServerResetQueryAlways = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("autodb_idle_timeout", AutodbIdleTimeout); + writer.WriteIntValue("autodb_max_db_connections", AutodbMaxDbConnections); + writer.WriteEnumValue("autodb_pool_mode", AutodbPoolMode); + writer.WriteIntValue("autodb_pool_size", AutodbPoolSize); + writer.WriteCollectionOfEnumValues("ignore_startup_parameters", IgnoreStartupParameters); + writer.WriteIntValue("min_pool_size", MinPoolSize); + writer.WriteIntValue("server_idle_timeout", ServerIdleTimeout); + writer.WriteIntValue("server_lifetime", ServerLifetime); + writer.WriteBoolValue("server_reset_query_always", ServerResetQueryAlways); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config_autodb_pool_mode.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config_autodb_pool_mode.cs new file mode 100644 index 0000000..9ee39c2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config_autodb_pool_mode.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// PGBouncer pool mode + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Pgbouncer_advanced_config_autodb_pool_mode + { + [EnumMember(Value = "session")] + #pragma warning disable CS1591 + Session, + #pragma warning restore CS1591 + [EnumMember(Value = "transaction")] + #pragma warning disable CS1591 + Transaction, + #pragma warning restore CS1591 + [EnumMember(Value = "statement")] + #pragma warning disable CS1591 + Statement, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config_ignore_startup_parameters.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config_ignore_startup_parameters.cs new file mode 100644 index 0000000..c4b515f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Pgbouncer_advanced_config_ignore_startup_parameters.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Enum of parameters to ignore when given in startup packet. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Pgbouncer_advanced_config_ignore_startup_parameters + { + [EnumMember(Value = "extra_float_digits")] + #pragma warning disable CS1591 + Extra_float_digits, + #pragma warning restore CS1591 + [EnumMember(Value = "search_path")] + #pragma warning disable CS1591 + Search_path, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config.cs new file mode 100644 index 0000000..7bf1fc2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config.cs @@ -0,0 +1,295 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Postgres_advanced_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Specifies a fraction, in a decimal value, of the table size to add to autovacuum_analyze_threshold when deciding whether to trigger an ANALYZE. The default is 0.2 (20% of table size). + public double? AutovacuumAnalyzeScaleFactor { get; set; } + /// Specifies the minimum number of inserted, updated, or deleted tuples needed to trigger an ANALYZE in any one table. The default is 50 tuples. + public int? AutovacuumAnalyzeThreshold { get; set; } + /// Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before a VACUUM operation is forced to prevent transaction ID wraparound within the table. Note that the system will launch autovacuum processes to prevent wraparound even when autovacuum is otherwise disabled. This parameter will cause the server to be restarted. + public int? AutovacuumFreezeMaxAge { get; set; } + /// Specifies the maximum number of autovacuum processes (other than the autovacuum launcher) that may be running at any one time. The default is three. This parameter can only be set at server start. + public int? AutovacuumMaxWorkers { get; set; } + /// Specifies the minimum delay, in seconds, between autovacuum runs on any given database. The default is one minute. + public int? AutovacuumNaptime { get; set; } + /// Specifies the cost delay value, in milliseconds, that will be used in automatic VACUUM operations. If -1, uses the regular vacuum_cost_delay value, which is 20 milliseconds. + public int? AutovacuumVacuumCostDelay { get; set; } + /// Specifies the cost limit value that will be used in automatic VACUUM operations. If -1 is specified (which is the default), the regular vacuum_cost_limit value will be used. + public int? AutovacuumVacuumCostLimit { get; set; } + /// Specifies a fraction, in a decimal value, of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM. The default is 0.2 (20% of table size). + public double? AutovacuumVacuumScaleFactor { get; set; } + /// Specifies the minimum number of updated or deleted tuples needed to trigger a VACUUM in any one table. The default is 50 tuples. + public int? AutovacuumVacuumThreshold { get; set; } + /// The hour of day (in UTC) when backup for the service starts. New backup only starts if previous backup has already completed. + public int? BackupHour { get; set; } + /// The minute of the backup hour when backup for the service starts. New backup is only started if previous backup has already completed. + public int? BackupMinute { get; set; } + /// Specifies the delay, in milliseconds, between activity rounds for the background writer. Default is 200 ms. + public int? BgwriterDelay { get; set; } + /// The amount of kilobytes that need to be written by the background writer before attempting to force the OS to issue these writes to underlying storage. Specified in kilobytes, default is 512. Setting of 0 disables forced writeback. + public int? BgwriterFlushAfter { get; set; } + /// The maximum number of buffers that the background writer can write. Setting this to zero disables background writing. Default is 100. + public int? BgwriterLruMaxpages { get; set; } + /// The average recent need for new buffers is multiplied by bgwriter_lru_multiplier to arrive at an estimate of the number that will be needed during the next round, (up to bgwriter_lru_maxpages). 1.0 represents a β€œjust in time” policy of writing exactly the number of buffers predicted to be needed. Larger values provide some cushion against spikes in demand, while smaller values intentionally leave writes to be done by server processes. The default is 2.0. + public double? BgwriterLruMultiplier { get; set; } + /// The amount of time, in milliseconds, to wait on a lock before checking to see if there is a deadlock condition. + public int? DeadlockTimeout { get; set; } + /// Specifies the default TOAST compression method for values of compressible columns (the default is lz4). + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_default_toast_compression? DefaultToastCompression { get; set; } + /// Time out sessions with open transactions after this number of milliseconds + public int? IdleInTransactionSessionTimeout { get; set; } + /// Activates, in a boolean, the system-wide use of Just-in-Time Compilation (JIT). + public bool? Jit { get; set; } + /// Causes each action executed by autovacuum to be logged if it ran for at least the specified number of milliseconds. Setting this to zero logs all autovacuum actions. Minus-one (the default) disables logging autovacuum actions. + public int? LogAutovacuumMinDuration { get; set; } + /// Controls the amount of detail written in the server log for each message that is logged. + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_log_error_verbosity? LogErrorVerbosity { get; set; } + /// Selects one of the available log-formats. These can support popular log analyzers like pgbadger, pganalyze, etc. + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_log_line_prefix? LogLinePrefix { get; set; } + /// Log statements that take more than this number of milliseconds to run. If -1, disables. + public int? LogMinDurationStatement { get; set; } + /// Number of seconds of master unavailability before triggering database failover to standby. The default value is 60. + public int? MaxFailoverReplicationTimeLag { get; set; } + /// PostgreSQL maximum number of files that can be open per process. + public int? MaxFilesPerProcess { get; set; } + /// PostgreSQL maximum locks per transaction. Once increased, this parameter cannot be lowered from its set value. + public int? MaxLocksPerTransaction { get; set; } + /// PostgreSQL maximum logical replication workers (taken from the pool of max_parallel_workers). + public int? MaxLogicalReplicationWorkers { get; set; } + /// Sets the maximum number of workers that the system can support for parallel queries. + public int? MaxParallelWorkers { get; set; } + /// Sets the maximum number of workers that can be started by a single Gather or Gather Merge node. + public int? MaxParallelWorkersPerGather { get; set; } + /// PostgreSQL maximum predicate locks per transaction. + public int? MaxPredLocksPerTransaction { get; set; } + /// PostgreSQL maximum prepared transactions. Once increased, this parameter cannot be lowered from its set value. + public int? MaxPreparedTransactions { get; set; } + /// PostgreSQL maximum replication slots. + public int? MaxReplicationSlots { get; set; } + /// Maximum depth of the stack in bytes. + public int? MaxStackDepth { get; set; } + /// Max standby archive delay in milliseconds. + public int? MaxStandbyArchiveDelay { get; set; } + /// Max standby streaming delay in milliseconds. + public int? MaxStandbyStreamingDelay { get; set; } + /// PostgreSQL maximum WAL senders. Once increased, this parameter cannot be lowered from its set value. + public int? MaxWalSenders { get; set; } + /// Sets the maximum number of background processes that the system can support. Once increased, this parameter cannot be lowered from its set value. + public int? MaxWorkerProcesses { get; set; } + /// PGBouncer connection pooling settings +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Pgbouncer_advanced_config? Pgbouncer { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Pgbouncer_advanced_config Pgbouncer { get; set; } +#endif + /// Sets the time interval to run pg_partman's scheduled tasks. + public int? PgPartmanBgwInterval { get; set; } + /// Controls which role to use for pg_partman's scheduled background tasks. Must consist of alpha-numeric characters, dots, underscores, or dashes. May not start with dash or dot. Maximum of 64 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PgPartmanBgwRole { get; set; } +#nullable restore +#else + public string PgPartmanBgwRole { get; set; } +#endif + /// Controls which statements are counted. Specify 'top' to track top-level statements (those issued directly by clients), 'all' to also track nested statements (such as statements invoked within functions), or 'none' to disable statement statistics collection. The default value is top. + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_pg_stat_statementsTrack? PgStatStatementsTrack { get; set; } + /// Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value. + public double? SharedBuffersPercentage { get; set; } + /// Enable the pg_stat_monitor extension. <b>Enabling this extension will cause the cluster to be restarted.</b> When this extension is enabled, pg_stat_statements results for utility commands are unreliable. + public bool? StatMonitorEnable { get; set; } + /// Synchronous replication type. Note that the service plan also needs to support synchronous replication. + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_synchronous_replication? SynchronousReplication { get; set; } + /// PostgreSQL temporary file limit in KiB. If -1, sets to unlimited. + public int? TempFileLimit { get; set; } + /// TimescaleDB extension configuration values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Timescaledb_advanced_config? Timescaledb { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Timescaledb_advanced_config Timescaledb { get; set; } +#endif + /// PostgreSQL service timezone +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Timezone { get; set; } +#nullable restore +#else + public string Timezone { get; set; } +#endif + /// Specifies the number of bytes reserved to track the currently executing command for each active session. + public int? TrackActivityQuerySize { get; set; } + /// Record commit time of transactions. + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_track_commit_timestamp? TrackCommitTimestamp { get; set; } + /// Enables tracking of function call counts and time used. + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_track_functions? TrackFunctions { get; set; } + /// Enables timing of database I/O calls. This parameter is off by default, because it will repeatedly query the operating system for the current time, which may cause significant overhead on some platforms. + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config_track_io_timing? TrackIoTiming { get; set; } + /// Terminate replication connections that are inactive for longer than this amount of time, in milliseconds. Setting this value to zero disables the timeout. Must be either 0 or between 5000 and 10800000. + public int? WalSenderTimeout { get; set; } + /// WAL flush interval in milliseconds. Note that setting this value to lower than the default 200ms may negatively impact performance + public int? WalWriterDelay { get; set; } + /// The maximum amount of memory, in MB, used by a query operation (such as a sort or hash table) before writing to temporary disk files. Default is 1MB + 0.075% of total RAM (up to 32MB). + public int? WorkMem { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Postgres_advanced_config() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "autovacuum_analyze_scale_factor", n => { AutovacuumAnalyzeScaleFactor = n.GetDoubleValue(); } }, + { "autovacuum_analyze_threshold", n => { AutovacuumAnalyzeThreshold = n.GetIntValue(); } }, + { "autovacuum_freeze_max_age", n => { AutovacuumFreezeMaxAge = n.GetIntValue(); } }, + { "autovacuum_max_workers", n => { AutovacuumMaxWorkers = n.GetIntValue(); } }, + { "autovacuum_naptime", n => { AutovacuumNaptime = n.GetIntValue(); } }, + { "autovacuum_vacuum_cost_delay", n => { AutovacuumVacuumCostDelay = n.GetIntValue(); } }, + { "autovacuum_vacuum_cost_limit", n => { AutovacuumVacuumCostLimit = n.GetIntValue(); } }, + { "autovacuum_vacuum_scale_factor", n => { AutovacuumVacuumScaleFactor = n.GetDoubleValue(); } }, + { "autovacuum_vacuum_threshold", n => { AutovacuumVacuumThreshold = n.GetIntValue(); } }, + { "backup_hour", n => { BackupHour = n.GetIntValue(); } }, + { "backup_minute", n => { BackupMinute = n.GetIntValue(); } }, + { "bgwriter_delay", n => { BgwriterDelay = n.GetIntValue(); } }, + { "bgwriter_flush_after", n => { BgwriterFlushAfter = n.GetIntValue(); } }, + { "bgwriter_lru_maxpages", n => { BgwriterLruMaxpages = n.GetIntValue(); } }, + { "bgwriter_lru_multiplier", n => { BgwriterLruMultiplier = n.GetDoubleValue(); } }, + { "deadlock_timeout", n => { DeadlockTimeout = n.GetIntValue(); } }, + { "default_toast_compression", n => { DefaultToastCompression = n.GetEnumValue(); } }, + { "idle_in_transaction_session_timeout", n => { IdleInTransactionSessionTimeout = n.GetIntValue(); } }, + { "jit", n => { Jit = n.GetBoolValue(); } }, + { "log_autovacuum_min_duration", n => { LogAutovacuumMinDuration = n.GetIntValue(); } }, + { "log_error_verbosity", n => { LogErrorVerbosity = n.GetEnumValue(); } }, + { "log_line_prefix", n => { LogLinePrefix = n.GetEnumValue(); } }, + { "log_min_duration_statement", n => { LogMinDurationStatement = n.GetIntValue(); } }, + { "max_failover_replication_time_lag", n => { MaxFailoverReplicationTimeLag = n.GetIntValue(); } }, + { "max_files_per_process", n => { MaxFilesPerProcess = n.GetIntValue(); } }, + { "max_locks_per_transaction", n => { MaxLocksPerTransaction = n.GetIntValue(); } }, + { "max_logical_replication_workers", n => { MaxLogicalReplicationWorkers = n.GetIntValue(); } }, + { "max_parallel_workers", n => { MaxParallelWorkers = n.GetIntValue(); } }, + { "max_parallel_workers_per_gather", n => { MaxParallelWorkersPerGather = n.GetIntValue(); } }, + { "max_pred_locks_per_transaction", n => { MaxPredLocksPerTransaction = n.GetIntValue(); } }, + { "max_prepared_transactions", n => { MaxPreparedTransactions = n.GetIntValue(); } }, + { "max_replication_slots", n => { MaxReplicationSlots = n.GetIntValue(); } }, + { "max_stack_depth", n => { MaxStackDepth = n.GetIntValue(); } }, + { "max_standby_archive_delay", n => { MaxStandbyArchiveDelay = n.GetIntValue(); } }, + { "max_standby_streaming_delay", n => { MaxStandbyStreamingDelay = n.GetIntValue(); } }, + { "max_wal_senders", n => { MaxWalSenders = n.GetIntValue(); } }, + { "max_worker_processes", n => { MaxWorkerProcesses = n.GetIntValue(); } }, + { "pg_partman_bgw.interval", n => { PgPartmanBgwInterval = n.GetIntValue(); } }, + { "pg_partman_bgw.role", n => { PgPartmanBgwRole = n.GetStringValue(); } }, + { "pg_stat_statements.track", n => { PgStatStatementsTrack = n.GetEnumValue(); } }, + { "pgbouncer", n => { Pgbouncer = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Pgbouncer_advanced_config.CreateFromDiscriminatorValue); } }, + { "shared_buffers_percentage", n => { SharedBuffersPercentage = n.GetDoubleValue(); } }, + { "stat_monitor_enable", n => { StatMonitorEnable = n.GetBoolValue(); } }, + { "synchronous_replication", n => { SynchronousReplication = n.GetEnumValue(); } }, + { "temp_file_limit", n => { TempFileLimit = n.GetIntValue(); } }, + { "timescaledb", n => { Timescaledb = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Timescaledb_advanced_config.CreateFromDiscriminatorValue); } }, + { "timezone", n => { Timezone = n.GetStringValue(); } }, + { "track_activity_query_size", n => { TrackActivityQuerySize = n.GetIntValue(); } }, + { "track_commit_timestamp", n => { TrackCommitTimestamp = n.GetEnumValue(); } }, + { "track_functions", n => { TrackFunctions = n.GetEnumValue(); } }, + { "track_io_timing", n => { TrackIoTiming = n.GetEnumValue(); } }, + { "wal_sender_timeout", n => { WalSenderTimeout = n.GetIntValue(); } }, + { "wal_writer_delay", n => { WalWriterDelay = n.GetIntValue(); } }, + { "work_mem", n => { WorkMem = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDoubleValue("autovacuum_analyze_scale_factor", AutovacuumAnalyzeScaleFactor); + writer.WriteIntValue("autovacuum_analyze_threshold", AutovacuumAnalyzeThreshold); + writer.WriteIntValue("autovacuum_freeze_max_age", AutovacuumFreezeMaxAge); + writer.WriteIntValue("autovacuum_max_workers", AutovacuumMaxWorkers); + writer.WriteIntValue("autovacuum_naptime", AutovacuumNaptime); + writer.WriteIntValue("autovacuum_vacuum_cost_delay", AutovacuumVacuumCostDelay); + writer.WriteIntValue("autovacuum_vacuum_cost_limit", AutovacuumVacuumCostLimit); + writer.WriteDoubleValue("autovacuum_vacuum_scale_factor", AutovacuumVacuumScaleFactor); + writer.WriteIntValue("autovacuum_vacuum_threshold", AutovacuumVacuumThreshold); + writer.WriteIntValue("backup_hour", BackupHour); + writer.WriteIntValue("backup_minute", BackupMinute); + writer.WriteIntValue("bgwriter_delay", BgwriterDelay); + writer.WriteIntValue("bgwriter_flush_after", BgwriterFlushAfter); + writer.WriteIntValue("bgwriter_lru_maxpages", BgwriterLruMaxpages); + writer.WriteDoubleValue("bgwriter_lru_multiplier", BgwriterLruMultiplier); + writer.WriteIntValue("deadlock_timeout", DeadlockTimeout); + writer.WriteEnumValue("default_toast_compression", DefaultToastCompression); + writer.WriteIntValue("idle_in_transaction_session_timeout", IdleInTransactionSessionTimeout); + writer.WriteBoolValue("jit", Jit); + writer.WriteIntValue("log_autovacuum_min_duration", LogAutovacuumMinDuration); + writer.WriteEnumValue("log_error_verbosity", LogErrorVerbosity); + writer.WriteEnumValue("log_line_prefix", LogLinePrefix); + writer.WriteIntValue("log_min_duration_statement", LogMinDurationStatement); + writer.WriteIntValue("max_failover_replication_time_lag", MaxFailoverReplicationTimeLag); + writer.WriteIntValue("max_files_per_process", MaxFilesPerProcess); + writer.WriteIntValue("max_locks_per_transaction", MaxLocksPerTransaction); + writer.WriteIntValue("max_logical_replication_workers", MaxLogicalReplicationWorkers); + writer.WriteIntValue("max_parallel_workers", MaxParallelWorkers); + writer.WriteIntValue("max_parallel_workers_per_gather", MaxParallelWorkersPerGather); + writer.WriteIntValue("max_pred_locks_per_transaction", MaxPredLocksPerTransaction); + writer.WriteIntValue("max_prepared_transactions", MaxPreparedTransactions); + writer.WriteIntValue("max_replication_slots", MaxReplicationSlots); + writer.WriteIntValue("max_stack_depth", MaxStackDepth); + writer.WriteIntValue("max_standby_archive_delay", MaxStandbyArchiveDelay); + writer.WriteIntValue("max_standby_streaming_delay", MaxStandbyStreamingDelay); + writer.WriteIntValue("max_wal_senders", MaxWalSenders); + writer.WriteIntValue("max_worker_processes", MaxWorkerProcesses); + writer.WriteIntValue("pg_partman_bgw.interval", PgPartmanBgwInterval); + writer.WriteStringValue("pg_partman_bgw.role", PgPartmanBgwRole); + writer.WriteEnumValue("pg_stat_statements.track", PgStatStatementsTrack); + writer.WriteObjectValue("pgbouncer", Pgbouncer); + writer.WriteDoubleValue("shared_buffers_percentage", SharedBuffersPercentage); + writer.WriteBoolValue("stat_monitor_enable", StatMonitorEnable); + writer.WriteEnumValue("synchronous_replication", SynchronousReplication); + writer.WriteIntValue("temp_file_limit", TempFileLimit); + writer.WriteObjectValue("timescaledb", Timescaledb); + writer.WriteStringValue("timezone", Timezone); + writer.WriteIntValue("track_activity_query_size", TrackActivityQuerySize); + writer.WriteEnumValue("track_commit_timestamp", TrackCommitTimestamp); + writer.WriteEnumValue("track_functions", TrackFunctions); + writer.WriteEnumValue("track_io_timing", TrackIoTiming); + writer.WriteIntValue("wal_sender_timeout", WalSenderTimeout); + writer.WriteIntValue("wal_writer_delay", WalWriterDelay); + writer.WriteIntValue("work_mem", WorkMem); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_default_toast_compression.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_default_toast_compression.cs new file mode 100644 index 0000000..47554c7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_default_toast_compression.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Specifies the default TOAST compression method for values of compressible columns (the default is lz4). + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_default_toast_compression + { + [EnumMember(Value = "lz4")] + #pragma warning disable CS1591 + Lz4, + #pragma warning restore CS1591 + [EnumMember(Value = "pglz")] + #pragma warning disable CS1591 + Pglz, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_log_error_verbosity.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_log_error_verbosity.cs new file mode 100644 index 0000000..55bc39b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_log_error_verbosity.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Controls the amount of detail written in the server log for each message that is logged. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_log_error_verbosity + { + [EnumMember(Value = "TERSE")] + #pragma warning disable CS1591 + TERSE, + #pragma warning restore CS1591 + [EnumMember(Value = "DEFAULT")] + #pragma warning disable CS1591 + DEFAULT, + #pragma warning restore CS1591 + [EnumMember(Value = "VERBOSE")] + #pragma warning disable CS1591 + VERBOSE, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_log_line_prefix.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_log_line_prefix.cs new file mode 100644 index 0000000..ef19673 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_log_line_prefix.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Selects one of the available log-formats. These can support popular log analyzers like pgbadger, pganalyze, etc. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_log_line_prefix + { + [EnumMember(Value = "pid=%p,user=%u,db=%d,app=%a,client=%h")] + #pragma warning disable CS1591 + PidPUserUDbDAppAClientH, + #pragma warning restore CS1591 + [EnumMember(Value = "%m [%p] %q[user=%u,db=%d,app=%a]")] + #pragma warning disable CS1591 + MPQUserUDbDAppA, + #pragma warning restore CS1591 + [EnumMember(Value = "%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h")] + #pragma warning disable CS1591 + TPL1UserUDbDAppAClientH, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_pg_stat_statementsTrack.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_pg_stat_statementsTrack.cs new file mode 100644 index 0000000..df24d83 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_pg_stat_statementsTrack.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Controls which statements are counted. Specify 'top' to track top-level statements (those issued directly by clients), 'all' to also track nested statements (such as statements invoked within functions), or 'none' to disable statement statistics collection. The default value is top. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_pg_stat_statementsTrack + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "top")] + #pragma warning disable CS1591 + Top, + #pragma warning restore CS1591 + [EnumMember(Value = "none")] + #pragma warning disable CS1591 + None, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_synchronous_replication.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_synchronous_replication.cs new file mode 100644 index 0000000..5f728a3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_synchronous_replication.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Synchronous replication type. Note that the service plan also needs to support synchronous replication. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_synchronous_replication + { + [EnumMember(Value = "off")] + #pragma warning disable CS1591 + Off, + #pragma warning restore CS1591 + [EnumMember(Value = "quorum")] + #pragma warning disable CS1591 + Quorum, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_commit_timestamp.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_commit_timestamp.cs new file mode 100644 index 0000000..52b4bc5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_commit_timestamp.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Record commit time of transactions. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_track_commit_timestamp + { + [EnumMember(Value = "off")] + #pragma warning disable CS1591 + Off, + #pragma warning restore CS1591 + [EnumMember(Value = "on")] + #pragma warning disable CS1591 + On, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_functions.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_functions.cs new file mode 100644 index 0000000..c6b002b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_functions.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Enables tracking of function call counts and time used. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_track_functions + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "pl")] + #pragma warning disable CS1591 + Pl, + #pragma warning restore CS1591 + [EnumMember(Value = "none")] + #pragma warning disable CS1591 + None, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_io_timing.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_io_timing.cs new file mode 100644 index 0000000..aa9945c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Postgres_advanced_config_track_io_timing.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Enables timing of database I/O calls. This parameter is off by default, because it will repeatedly query the operating system for the current time, which may cause significant overhead on some platforms. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Postgres_advanced_config_track_io_timing + { + [EnumMember(Value = "off")] + #pragma warning disable CS1591 + Off, + #pragma warning restore CS1591 + [EnumMember(Value = "on")] + #pragma warning disable CS1591 + On, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Previous_outage.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Previous_outage.cs new file mode 100644 index 0000000..ad56a79 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Previous_outage.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Previous_outage : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The duration_seconds property + public int? DurationSeconds { get; set; } + /// The ended_at property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EndedAt { get; set; } +#nullable restore +#else + public string EndedAt { get; set; } +#endif + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// The started_at property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? StartedAt { get; set; } +#nullable restore +#else + public string StartedAt { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Previous_outage() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Previous_outage CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Previous_outage(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "duration_seconds", n => { DurationSeconds = n.GetIntValue(); } }, + { "ended_at", n => { EndedAt = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "started_at", n => { StartedAt = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("duration_seconds", DurationSeconds); + writer.WriteStringValue("ended_at", EndedAt); + writer.WriteStringValue("region", Region); + writer.WriteStringValue("started_at", StartedAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Product_charge_item.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Product_charge_item.cs new file mode 100644 index 0000000..e9730ca --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Product_charge_item.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Product_charge_item : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Amount of the charge +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Amount { get; set; } +#nullable restore +#else + public string Amount { get; set; } +#endif + /// Number of times the charge was applied +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Count { get; set; } +#nullable restore +#else + public string Count { get; set; } +#endif + /// Description of the charge +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Product_charge_item() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Product_charge_item CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Product_charge_item(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetStringValue(); } }, + { "count", n => { Count = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("amount", Amount); + writer.WriteStringValue("count", Count); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Product_usage_charges.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Product_usage_charges.cs new file mode 100644 index 0000000..29b16a2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Product_usage_charges.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Product_usage_charges : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Total amount charged +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Amount { get; set; } +#nullable restore +#else + public string Amount { get; set; } +#endif + /// List of amount, and grouped aggregates by resource type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Description of usage charges +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Product_usage_charges() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Product_usage_charges CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Product_usage_charges(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetStringValue(); } }, + { "items", n => { Items = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Product_charge_item.CreateFromDiscriminatorValue)?.AsList(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("amount", Amount); + writer.WriteCollectionOfObjectValues("items", Items); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Project.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Project.cs new file mode 100644 index 0000000..5ed39ef --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Project.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Project : global::InfinityFlow.DigitalOcean.Client.Models.Project_base, IParsable + #pragma warning restore CS1591 + { + /// If true, all resources will be added to this project if no project is specified. + public bool? IsDefault { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Project CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Project(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "is_default", n => { IsDefault = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteBoolValue("is_default", IsDefault); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Project_assignment.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Project_assignment.cs new file mode 100644 index 0000000..c2b8d89 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Project_assignment.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Project_assignment : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of uniform resource names (URNs) to be added to a project. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Project_assignment() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "resources", n => { Resources = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Project_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Project_base.cs new file mode 100644 index 0000000..1baafa6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Project_base.cs @@ -0,0 +1,110 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Project_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the project was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// The description of the project. The maximum length is 255 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The environment of the project's resources. + public global::InfinityFlow.DigitalOcean.Client.Models.Project_base_environment? Environment { get; set; } + /// The unique universal identifier of this project. + public Guid? Id { get; private set; } + /// The human-readable name for the project. The maximum length is 175 characters and the name must be unique. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The integer id of the project owner. + public int? OwnerId { get; private set; } + /// The unique universal identifier of the project owner. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OwnerUuid { get; private set; } +#nullable restore +#else + public string OwnerUuid { get; private set; } +#endif + /// The purpose of the project. The maximum length is 255 characters. It canhave one of the following values:- Just trying out DigitalOcean- Class project / Educational purposes- Website or blog- Web Application- Service or API- Mobile Application- Machine learning / AI / Data processing- IoT- Operational / Developer toolingIf another value for purpose is specified, for example, "your custom purpose",your purpose will be stored as `Other: your custom purpose`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Purpose { get; set; } +#nullable restore +#else + public string Purpose { get; set; } +#endif + /// A time value given in ISO8601 combined date and time format that represents when the project was updated. + public DateTimeOffset? UpdatedAt { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public Project_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Project_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Project_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "environment", n => { Environment = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "owner_id", n => { OwnerId = n.GetIntValue(); } }, + { "owner_uuid", n => { OwnerUuid = n.GetStringValue(); } }, + { "purpose", n => { Purpose = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteEnumValue("environment", Environment); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("purpose", Purpose); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Project_base_environment.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Project_base_environment.cs new file mode 100644 index 0000000..473bdd8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Project_base_environment.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The environment of the project's resources. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Project_base_environment + { + [EnumMember(Value = "Development")] + #pragma warning disable CS1591 + Development, + #pragma warning restore CS1591 + [EnumMember(Value = "Staging")] + #pragma warning disable CS1591 + Staging, + #pragma warning restore CS1591 + [EnumMember(Value = "Production")] + #pragma warning disable CS1591 + Production, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Purge_cache.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Purge_cache.cs new file mode 100644 index 0000000..330d3ee --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Purge_cache.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Purge_cache : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of strings containing the path to the content to be purged from the CDN cache. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Files { get; set; } +#nullable restore +#else + public List Files { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Purge_cache() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Purge_cache CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Purge_cache(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "files", n => { Files = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("files", Files); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config.cs new file mode 100644 index 0000000..9085e97 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Redis_advanced_config : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Determines default pub/sub channels' ACL for new users if ACL is not supplied. When this option is not defined, all_channels is assumed to keep backward compatibility. This option doesn't affect Redis configuration acl-pubsub-default. + public global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config_redis_acl_channels_default? RedisAclChannelsDefault { get; set; } + /// Redis IO thread count + public int? RedisIoThreads { get; set; } + /// LFU maxmemory-policy counter decay time in minutes + public int? RedisLfuDecayTime { get; set; } + /// Counter logarithm factor for volatile-lfu and allkeys-lfu maxmemory-policies + public int? RedisLfuLogFactor { get; set; } + /// A string specifying the desired eviction policy for the Redis cluster.- `noeviction`: Don't evict any data, returns error when memory limit is reached.- `allkeys_lru:` Evict any key, least recently used (LRU) first.- `allkeys_random`: Evict keys in a random order.- `volatile_lru`: Evict keys with expiration only, least recently used (LRU) first.- `volatile_random`: Evict keys with expiration only in a random order.- `volatile_ttl`: Evict keys with expiration only, shortest time-to-live (TTL) first. + public global::InfinityFlow.DigitalOcean.Client.Models.Eviction_policy_model? RedisMaxmemoryPolicy { get; set; } + /// Set notify-keyspace-events option. Requires at least `K` or `E` and accepts any combination of the following options. Setting the parameter to `""` disables notifications.- `K` &mdash; Keyspace events- `E` &mdash; Keyevent events- `g` &mdash; Generic commands (e.g. `DEL`, `EXPIRE`, `RENAME`, ...)- `$` &mdash; String commands- `l` &mdash; List commands- `s` &mdash; Set commands- `h` &mdash; Hash commands- `z` &mdash; Sorted set commands- `t` &mdash; Stream commands- `d` &mdash; Module key type events- `x` &mdash; Expired events- `e` &mdash; Evicted events- `m` &mdash; Key miss events- `n` &mdash; New key events- `A` &mdash; Alias for `"g$lshztxed"` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RedisNotifyKeyspaceEvents { get; set; } +#nullable restore +#else + public string RedisNotifyKeyspaceEvents { get; set; } +#endif + /// Set number of redis databases. Changing this will cause a restart of redis service. + public int? RedisNumberOfDatabases { get; set; } + /// When persistence is 'rdb', Redis does RDB dumps each 10 minutes if any key is changed. Also RDB dumps are done according to backup schedule for backup purposes. When persistence is 'off', no RDB dumps and backups are done, so data can be lost at any moment if service is restarted for any reason, or if service is powered off. Also service can't be forked. + public global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config_redis_persistence? RedisPersistence { get; set; } + /// Set output buffer limit for pub / sub clients in MB. The value is the hard limit, the soft limit is 1/4 of the hard limit. When setting the limit, be mindful of the available memory in the selected service plan. + public int? RedisPubsubClientOutputBufferLimit { get; set; } + /// Require SSL to access Redis.- When enabled, Redis accepts only SSL connections on port `25061`.- When disabled, port `25060` is opened for non-SSL connections, while port `25061` remains available for SSL connections. + public bool? RedisSsl { get; set; } + /// Redis idle connection timeout in seconds + public int? RedisTimeout { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Redis_advanced_config() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "redis_acl_channels_default", n => { RedisAclChannelsDefault = n.GetEnumValue(); } }, + { "redis_io_threads", n => { RedisIoThreads = n.GetIntValue(); } }, + { "redis_lfu_decay_time", n => { RedisLfuDecayTime = n.GetIntValue(); } }, + { "redis_lfu_log_factor", n => { RedisLfuLogFactor = n.GetIntValue(); } }, + { "redis_maxmemory_policy", n => { RedisMaxmemoryPolicy = n.GetEnumValue(); } }, + { "redis_notify_keyspace_events", n => { RedisNotifyKeyspaceEvents = n.GetStringValue(); } }, + { "redis_number_of_databases", n => { RedisNumberOfDatabases = n.GetIntValue(); } }, + { "redis_persistence", n => { RedisPersistence = n.GetEnumValue(); } }, + { "redis_pubsub_client_output_buffer_limit", n => { RedisPubsubClientOutputBufferLimit = n.GetIntValue(); } }, + { "redis_ssl", n => { RedisSsl = n.GetBoolValue(); } }, + { "redis_timeout", n => { RedisTimeout = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("redis_acl_channels_default", RedisAclChannelsDefault); + writer.WriteIntValue("redis_io_threads", RedisIoThreads); + writer.WriteIntValue("redis_lfu_decay_time", RedisLfuDecayTime); + writer.WriteIntValue("redis_lfu_log_factor", RedisLfuLogFactor); + writer.WriteEnumValue("redis_maxmemory_policy", RedisMaxmemoryPolicy); + writer.WriteStringValue("redis_notify_keyspace_events", RedisNotifyKeyspaceEvents); + writer.WriteIntValue("redis_number_of_databases", RedisNumberOfDatabases); + writer.WriteEnumValue("redis_persistence", RedisPersistence); + writer.WriteIntValue("redis_pubsub_client_output_buffer_limit", RedisPubsubClientOutputBufferLimit); + writer.WriteBoolValue("redis_ssl", RedisSsl); + writer.WriteIntValue("redis_timeout", RedisTimeout); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config_redis_acl_channels_default.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config_redis_acl_channels_default.cs new file mode 100644 index 0000000..836d7cb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config_redis_acl_channels_default.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Determines default pub/sub channels' ACL for new users if ACL is not supplied. When this option is not defined, all_channels is assumed to keep backward compatibility. This option doesn't affect Redis configuration acl-pubsub-default. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Redis_advanced_config_redis_acl_channels_default + { + [EnumMember(Value = "allchannels")] + #pragma warning disable CS1591 + Allchannels, + #pragma warning restore CS1591 + [EnumMember(Value = "resetchannels")] + #pragma warning disable CS1591 + Resetchannels, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config_redis_persistence.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config_redis_persistence.cs new file mode 100644 index 0000000..5e0dca3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Redis_advanced_config_redis_persistence.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// When persistence is 'rdb', Redis does RDB dumps each 10 minutes if any key is changed. Also RDB dumps are done according to backup schedule for backup purposes. When persistence is 'off', no RDB dumps and backups are done, so data can be lost at any moment if service is restarted for any reason, or if service is powered off. Also service can't be forked. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Redis_advanced_config_redis_persistence + { + [EnumMember(Value = "off")] + #pragma warning disable CS1591 + Off, + #pragma warning restore CS1591 + [EnumMember(Value = "rdb")] + #pragma warning disable CS1591 + Rdb, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Region.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Region.cs new file mode 100644 index 0000000..93b5aa7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Region.cs @@ -0,0 +1,99 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Region : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// This is a boolean value that represents whether new Droplets can be created in this region. + public bool? Available { get; set; } + /// This attribute is set to an array which contains features available in this region +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UntypedNode? Features { get; set; } +#nullable restore +#else + public UntypedNode Features { get; set; } +#endif + /// The display name of the region. This will be a full name that is used in the control panel and other interfaces. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// This attribute is set to an array which contains the identifying slugs for the sizes available in this region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UntypedNode? Sizes { get; set; } +#nullable restore +#else + public UntypedNode Sizes { get; set; } +#endif + /// A human-readable string that is used as a unique identifier for each region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Region() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Region CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Region(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "available", n => { Available = n.GetBoolValue(); } }, + { "features", n => { Features = n.GetObjectValue(UntypedNode.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "sizes", n => { Sizes = n.GetObjectValue(UntypedNode.CreateFromDiscriminatorValue); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("available", Available); + writer.WriteObjectValue("features", Features); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("sizes", Sizes); + writer.WriteStringValue("slug", Slug); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Region_slug.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Region_slug.cs new file mode 100644 index 0000000..25a5361 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Region_slug.cs @@ -0,0 +1,71 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The slug identifier for the region where the resource will initially be available. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Region_slug + { + [EnumMember(Value = "ams1")] + #pragma warning disable CS1591 + Ams1, + #pragma warning restore CS1591 + [EnumMember(Value = "ams2")] + #pragma warning disable CS1591 + Ams2, + #pragma warning restore CS1591 + [EnumMember(Value = "ams3")] + #pragma warning disable CS1591 + Ams3, + #pragma warning restore CS1591 + [EnumMember(Value = "blr1")] + #pragma warning disable CS1591 + Blr1, + #pragma warning restore CS1591 + [EnumMember(Value = "fra1")] + #pragma warning disable CS1591 + Fra1, + #pragma warning restore CS1591 + [EnumMember(Value = "lon1")] + #pragma warning disable CS1591 + Lon1, + #pragma warning restore CS1591 + [EnumMember(Value = "nyc1")] + #pragma warning disable CS1591 + Nyc1, + #pragma warning restore CS1591 + [EnumMember(Value = "nyc2")] + #pragma warning disable CS1591 + Nyc2, + #pragma warning restore CS1591 + [EnumMember(Value = "nyc3")] + #pragma warning disable CS1591 + Nyc3, + #pragma warning restore CS1591 + [EnumMember(Value = "sfo1")] + #pragma warning disable CS1591 + Sfo1, + #pragma warning restore CS1591 + [EnumMember(Value = "sfo2")] + #pragma warning disable CS1591 + Sfo2, + #pragma warning restore CS1591 + [EnumMember(Value = "sfo3")] + #pragma warning disable CS1591 + Sfo3, + #pragma warning restore CS1591 + [EnumMember(Value = "sgp1")] + #pragma warning disable CS1591 + Sgp1, + #pragma warning restore CS1591 + [EnumMember(Value = "tor1")] + #pragma warning disable CS1591 + Tor1, + #pragma warning restore CS1591 + [EnumMember(Value = "syd1")] + #pragma warning disable CS1591 + Syd1, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Region_state.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Region_state.cs new file mode 100644 index 0000000..154aab6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Region_state.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Region_state : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The status property + public global::InfinityFlow.DigitalOcean.Client.Models.Region_state_status? Status { get; set; } + /// The status_changed_at property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? StatusChangedAt { get; set; } +#nullable restore +#else + public string StatusChangedAt { get; set; } +#endif + /// The thirty_day_uptime_percentage property + public double? ThirtyDayUptimePercentage { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Region_state() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Region_state CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Region_state(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "status", n => { Status = n.GetEnumValue(); } }, + { "status_changed_at", n => { StatusChangedAt = n.GetStringValue(); } }, + { "thirty_day_uptime_percentage", n => { ThirtyDayUptimePercentage = n.GetDoubleValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("status", Status); + writer.WriteStringValue("status_changed_at", StatusChangedAt); + writer.WriteDoubleValue("thirty_day_uptime_percentage", ThirtyDayUptimePercentage); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Region_state_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Region_state_status.cs new file mode 100644 index 0000000..d9e94a5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Region_state_status.cs @@ -0,0 +1,24 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum Region_state_status + #pragma warning restore CS1591 + { + [EnumMember(Value = "DOWN")] + #pragma warning disable CS1591 + DOWN, + #pragma warning restore CS1591 + [EnumMember(Value = "UP")] + #pragma warning disable CS1591 + UP, + #pragma warning restore CS1591 + [EnumMember(Value = "CHECKING")] + #pragma warning disable CS1591 + CHECKING, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Regional_state.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Regional_state.cs new file mode 100644 index 0000000..62c8c91 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Regional_state.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// A map of region to regional state + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Regional_state : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The eu_west property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Region_state? EuWest { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Region_state EuWest { get; set; } +#endif + /// The us_east property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Region_state? UsEast { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Region_state UsEast { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Regional_state() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Regional_state CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Regional_state(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "eu_west", n => { EuWest = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Region_state.CreateFromDiscriminatorValue); } }, + { "us_east", n => { UsEast = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Region_state.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("eu_west", EuWest); + writer.WriteObjectValue("us_east", UsEast); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Registry.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Registry.cs new file mode 100644 index 0000000..ad20008 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Registry.cs @@ -0,0 +1,94 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Registry : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the registry was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and `-`, up to a limit of 63 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Slug of the region where registry data is stored +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// The amount of storage used in the registry in bytes. + public int? StorageUsageBytes { get; private set; } + /// The time at which the storage usage was updated. Storage usage is calculated asynchronously, and may not immediately reflect pushes to the registry. + public DateTimeOffset? StorageUsageBytesUpdatedAt { get; private set; } + /// The subscription property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription? Subscription { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription Subscription { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Registry() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Registry CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Registry(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "storage_usage_bytes", n => { StorageUsageBytes = n.GetIntValue(); } }, + { "storage_usage_bytes_updated_at", n => { StorageUsageBytesUpdatedAt = n.GetDateTimeOffsetValue(); } }, + { "subscription", n => { Subscription = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Subscription.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("region", Region); + writer.WriteObjectValue("subscription", Subscription); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create.cs new file mode 100644 index 0000000..cf7e031 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Registry_create : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and `-`, up to a limit of 63 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Slug of the region where registry data is stored. When not provided, a region will be selected. + public global::InfinityFlow.DigitalOcean.Client.Models.Registry_create_region? Region { get; set; } + /// The slug of the subscription tier to sign up for. Valid values can be retrieved using the options endpoint. + public global::InfinityFlow.DigitalOcean.Client.Models.Registry_create_subscription_tier_slug? SubscriptionTierSlug { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Registry_create() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Registry_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Registry_create(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "region", n => { Region = n.GetEnumValue(); } }, + { "subscription_tier_slug", n => { SubscriptionTierSlug = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("region", Region); + writer.WriteEnumValue("subscription_tier_slug", SubscriptionTierSlug); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create_region.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create_region.cs new file mode 100644 index 0000000..17d11f0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create_region.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Slug of the region where registry data is stored. When not provided, a region will be selected. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Registry_create_region + { + [EnumMember(Value = "nyc3")] + #pragma warning disable CS1591 + Nyc3, + #pragma warning restore CS1591 + [EnumMember(Value = "sfo3")] + #pragma warning disable CS1591 + Sfo3, + #pragma warning restore CS1591 + [EnumMember(Value = "ams3")] + #pragma warning disable CS1591 + Ams3, + #pragma warning restore CS1591 + [EnumMember(Value = "sgp1")] + #pragma warning disable CS1591 + Sgp1, + #pragma warning restore CS1591 + [EnumMember(Value = "fra1")] + #pragma warning disable CS1591 + Fra1, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create_subscription_tier_slug.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create_subscription_tier_slug.cs new file mode 100644 index 0000000..32d30c6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Registry_create_subscription_tier_slug.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The slug of the subscription tier to sign up for. Valid values can be retrieved using the options endpoint. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Registry_create_subscription_tier_slug + { + [EnumMember(Value = "starter")] + #pragma warning disable CS1591 + Starter, + #pragma warning restore CS1591 + [EnumMember(Value = "basic")] + #pragma warning disable CS1591 + Basic, + #pragma warning restore CS1591 + [EnumMember(Value = "professional")] + #pragma warning disable CS1591 + Professional, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Repository.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Repository.cs new file mode 100644 index 0000000..a3b7d1c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Repository.cs @@ -0,0 +1,89 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Repository : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The latest_tag property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Repository_tag? LatestTag { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Repository_tag LatestTag { get; set; } +#endif + /// The name of the repository. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The name of the container registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RegistryName { get; set; } +#nullable restore +#else + public string RegistryName { get; set; } +#endif + /// The number of tags in the repository. + public int? TagCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Repository() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Repository CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Repository(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "latest_tag", n => { LatestTag = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Repository_tag.CreateFromDiscriminatorValue); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "registry_name", n => { RegistryName = n.GetStringValue(); } }, + { "tag_count", n => { TagCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("latest_tag", LatestTag); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("registry_name", RegistryName); + writer.WriteIntValue("tag_count", TagCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Repository_blob.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_blob.cs new file mode 100644 index 0000000..f51f122 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_blob.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Repository_blob : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The compressed size of the blob in bytes. + public int? CompressedSizeBytes { get; set; } + /// The digest of the blob +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Digest { get; set; } +#nullable restore +#else + public string Digest { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Repository_blob() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Repository_blob CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Repository_blob(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "compressed_size_bytes", n => { CompressedSizeBytes = n.GetIntValue(); } }, + { "digest", n => { Digest = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("compressed_size_bytes", CompressedSizeBytes); + writer.WriteStringValue("digest", Digest); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Repository_manifest.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_manifest.cs new file mode 100644 index 0000000..267d1d6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_manifest.cs @@ -0,0 +1,117 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Repository_manifest : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// All blobs associated with this manifest +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Blobs { get; set; } +#nullable restore +#else + public List Blobs { get; set; } +#endif + /// The compressed size of the manifest in bytes. + public int? CompressedSizeBytes { get; set; } + /// The manifest digest +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Digest { get; set; } +#nullable restore +#else + public string Digest { get; set; } +#endif + /// The name of the container registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RegistryName { get; set; } +#nullable restore +#else + public string RegistryName { get; set; } +#endif + /// The name of the repository. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Repository { get; set; } +#nullable restore +#else + public string Repository { get; set; } +#endif + /// The uncompressed size of the manifest in bytes (this size is calculated asynchronously so it may not be immediately available). + public int? SizeBytes { get; set; } + /// All tags associated with this manifest +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// The time the manifest was last updated. + public DateTimeOffset? UpdatedAt { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Repository_manifest() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Repository_manifest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Repository_manifest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "blobs", n => { Blobs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Repository_blob.CreateFromDiscriminatorValue)?.AsList(); } }, + { "compressed_size_bytes", n => { CompressedSizeBytes = n.GetIntValue(); } }, + { "digest", n => { Digest = n.GetStringValue(); } }, + { "registry_name", n => { RegistryName = n.GetStringValue(); } }, + { "repository", n => { Repository = n.GetStringValue(); } }, + { "size_bytes", n => { SizeBytes = n.GetIntValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("blobs", Blobs); + writer.WriteIntValue("compressed_size_bytes", CompressedSizeBytes); + writer.WriteStringValue("digest", Digest); + writer.WriteStringValue("registry_name", RegistryName); + writer.WriteStringValue("repository", Repository); + writer.WriteIntValue("size_bytes", SizeBytes); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Repository_tag.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_tag.cs new file mode 100644 index 0000000..86928ed --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_tag.cs @@ -0,0 +1,107 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Repository_tag : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The compressed size of the tag in bytes. + public int? CompressedSizeBytes { get; set; } + /// The digest of the manifest associated with the tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ManifestDigest { get; set; } +#nullable restore +#else + public string ManifestDigest { get; set; } +#endif + /// The name of the container registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RegistryName { get; set; } +#nullable restore +#else + public string RegistryName { get; set; } +#endif + /// The name of the repository. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Repository { get; set; } +#nullable restore +#else + public string Repository { get; set; } +#endif + /// The uncompressed size of the tag in bytes (this size is calculated asynchronously so it may not be immediately available). + public int? SizeBytes { get; set; } + /// The name of the tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Tag { get; set; } +#nullable restore +#else + public string Tag { get; set; } +#endif + /// The time the tag was last updated. + public DateTimeOffset? UpdatedAt { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Repository_tag() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Repository_tag CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Repository_tag(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "compressed_size_bytes", n => { CompressedSizeBytes = n.GetIntValue(); } }, + { "manifest_digest", n => { ManifestDigest = n.GetStringValue(); } }, + { "registry_name", n => { RegistryName = n.GetStringValue(); } }, + { "repository", n => { Repository = n.GetStringValue(); } }, + { "size_bytes", n => { SizeBytes = n.GetIntValue(); } }, + { "tag", n => { Tag = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("compressed_size_bytes", CompressedSizeBytes); + writer.WriteStringValue("manifest_digest", ManifestDigest); + writer.WriteStringValue("registry_name", RegistryName); + writer.WriteStringValue("repository", Repository); + writer.WriteIntValue("size_bytes", SizeBytes); + writer.WriteStringValue("tag", Tag); + writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Repository_v2.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_v2.cs new file mode 100644 index 0000000..fa6536f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Repository_v2.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Repository_v2 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The latest_manifest property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Repository_manifest? LatestManifest { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Repository_manifest LatestManifest { get; set; } +#endif + /// The number of manifests in the repository. + public int? ManifestCount { get; set; } + /// The name of the repository. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The name of the container registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RegistryName { get; set; } +#nullable restore +#else + public string RegistryName { get; set; } +#endif + /// The number of tags in the repository. + public int? TagCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Repository_v2() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Repository_v2 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Repository_v2(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "latest_manifest", n => { LatestManifest = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Repository_manifest.CreateFromDiscriminatorValue); } }, + { "manifest_count", n => { ManifestCount = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "registry_name", n => { RegistryName = n.GetStringValue(); } }, + { "tag_count", n => { TagCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("latest_manifest", LatestManifest); + writer.WriteIntValue("manifest_count", ManifestCount); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("registry_name", RegistryName); + writer.WriteIntValue("tag_count", TagCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip.cs new file mode 100644 index 0000000..473bb19 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ip : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Droplet that the reserved IP has been assigned to. When you query a reserved IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet? Droplet { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet Droplet { get; set; } +#endif + /// The public IP address of the reserved IP. It also serves as its identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ip { get; set; } +#nullable restore +#else + public string Ip { get; set; } +#endif + /// A boolean value indicating whether or not the reserved IP has pending actions preventing new ones from being submitted. + public bool? Locked { get; set; } + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Region? Region { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Region Region { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Reserved_ip() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet", n => { Droplet = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet.CreateFromDiscriminatorValue); } }, + { "ip", n => { Ip = n.GetStringValue(); } }, + { "locked", n => { Locked = n.GetBoolValue(); } }, + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + { "region", n => { Region = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Region.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("droplet", Droplet); + writer.WriteStringValue("ip", Ip); + writer.WriteBoolValue("locked", Locked); + writer.WriteGuidValue("project_id", ProjectId); + writer.WriteObjectValue("region", Region); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_assign.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_assign.cs new file mode 100644 index 0000000..94200bc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_assign.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ip_action_assign : global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_type, IParsable + #pragma warning restore CS1591 + { + /// The ID of the Droplet that the reserved IP will be assigned to. + public int? DropletId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_assign CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_assign(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("droplet_id", DropletId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_type.cs new file mode 100644 index 0000000..89b6ff2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_type.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ip_action_type : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The type of action to initiate for the reserved IP. + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_type_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Reserved_ip_action_type() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_type CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); + return mappingValue switch + { + "assign" => new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_assign(), + "unassign" => new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_unassign(), + _ => new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_type(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_type_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_type_type.cs new file mode 100644 index 0000000..9f3b2dc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_type_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of action to initiate for the reserved IP. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Reserved_ip_action_type_type + { + [EnumMember(Value = "assign")] + #pragma warning disable CS1591 + Assign, + #pragma warning restore CS1591 + [EnumMember(Value = "unassign")] + #pragma warning disable CS1591 + Unassign, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_unassign.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_unassign.cs new file mode 100644 index 0000000..fb71ba8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_action_unassign.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ip_action_unassign : global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_type, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_unassign CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_unassign(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_create.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_create.cs new file mode 100644 index 0000000..18b2c0f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_create.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reserved_ip_create : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1? ReservedIpCreateMember1 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1 ReservedIpCreateMember1 { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2? ReservedIpCreateMember2 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2 ReservedIpCreateMember2 { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_create(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.ReservedIpCreateMember1 = new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1(); + } + else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.ReservedIpCreateMember2 = new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(ReservedIpCreateMember1 != null) + { + return ReservedIpCreateMember1.GetFieldDeserializers(); + } + else if(ReservedIpCreateMember2 != null) + { + return ReservedIpCreateMember2.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(ReservedIpCreateMember1 != null) + { + writer.WriteObjectValue(null, ReservedIpCreateMember1); + } + else if(ReservedIpCreateMember2 != null) + { + writer.WriteObjectValue(null, ReservedIpCreateMember2); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_createMember1.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_createMember1.cs new file mode 100644 index 0000000..95b6a52 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_createMember1.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ip_createMember1 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the Droplet that the reserved IP will be assigned to. + public int? DropletId { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Reserved_ip_createMember1() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("droplet_id", DropletId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_createMember2.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_createMember2.cs new file mode 100644 index 0000000..81a4dc6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Reserved_ip_createMember2.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ip_createMember2 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The UUID of the project to which the reserved IP will be assigned. + public Guid? ProjectId { get; set; } + /// The slug identifier for the region the reserved IP will be reserved to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Reserved_ip_createMember2() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("project_id", ProjectId); + writer.WriteStringValue("region", Region); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Resource.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Resource.cs new file mode 100644 index 0000000..d260663 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Resource.cs @@ -0,0 +1,83 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Resource : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the project was created. + public DateTimeOffset? AssignedAt { get; set; } + /// The links object contains the `self` object, which contains the resource relationship. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Resource_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Resource_links Links { get; set; } +#endif + /// The status of assigning and fetching the resources. + public global::InfinityFlow.DigitalOcean.Client.Models.Resource_status? Status { get; set; } + /// The uniform resource name (URN) for the resource in the format do:resource_type:resource_id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Urn { get; set; } +#nullable restore +#else + public string Urn { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Resource() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Resource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Resource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "assigned_at", n => { AssignedAt = n.GetDateTimeOffsetValue(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Resource_links.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "urn", n => { Urn = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("assigned_at", AssignedAt); + writer.WriteObjectValue("links", Links); + writer.WriteEnumValue("status", Status); + writer.WriteStringValue("urn", Urn); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Resource_links.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Resource_links.cs new file mode 100644 index 0000000..868033a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Resource_links.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// The links object contains the `self` object, which contains the resource relationship. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Resource_links : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A URI that can be used to retrieve the resource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self { get; set; } +#nullable restore +#else + public string Self { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Resource_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Resource_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Resource_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("self", Self); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Resource_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Resource_status.cs new file mode 100644 index 0000000..09d6f82 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Resource_status.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The status of assigning and fetching the resources. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Resource_status + { + [EnumMember(Value = "ok")] + #pragma warning disable CS1591 + Ok, + #pragma warning restore CS1591 + [EnumMember(Value = "not_found")] + #pragma warning disable CS1591 + Not_found, + #pragma warning restore CS1591 + [EnumMember(Value = "assigned")] + #pragma warning disable CS1591 + Assigned, + #pragma warning restore CS1591 + [EnumMember(Value = "already_assigned")] + #pragma warning disable CS1591 + Already_assigned, + #pragma warning restore CS1591 + [EnumMember(Value = "service_down")] + #pragma warning disable CS1591 + Service_down, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Rsyslog_logsink.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Rsyslog_logsink.cs new file mode 100644 index 0000000..9e689e8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Rsyslog_logsink.cs @@ -0,0 +1,127 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Rsyslog_logsink : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// PEM encoded CA certificate +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Ca { get; set; } +#nullable restore +#else + public string Ca { get; set; } +#endif + /// (PEM format) client cert to use +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Cert { get; set; } +#nullable restore +#else + public string Cert { get; set; } +#endif + /// Message format used by the server, this can be either rfc3164 (the old BSD style message format), `rfc5424` (current syslog message format) or custom + public global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink_format? Format { get; set; } + /// (PEM format) client key if the server requires client authentication +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// Conditional (required if `format` == `custom`).Syslog log line template for a custom format, supporting limited rsyslog style templating (using `%tag%`). Supported tags are: `HOSTNAME`, `app-name`, `msg`, `msgid`, `pri`, `procid`, `structured-data`, `timestamp` and `timestamp:::date-rfc3339`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Logline { get; set; } +#nullable restore +#else + public string Logline { get; set; } +#endif + /// The internal port on which the rsyslog server is listening + public int? Port { get; set; } + /// content of the structured data block of rfc5424 message +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Sd { get; set; } +#nullable restore +#else + public string Sd { get; set; } +#endif + /// DNS name or IPv4 address of the rsyslog server +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Server { get; set; } +#nullable restore +#else + public string Server { get; set; } +#endif + /// Use TLS (as the messages are not filtered and may contain sensitive information, it is highly recommended to set this to true if the remote server supports it) + public bool? Tls { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Rsyslog_logsink() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Rsyslog_logsink(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ca", n => { Ca = n.GetStringValue(); } }, + { "cert", n => { Cert = n.GetStringValue(); } }, + { "format", n => { Format = n.GetEnumValue(); } }, + { "key", n => { Key = n.GetStringValue(); } }, + { "logline", n => { Logline = n.GetStringValue(); } }, + { "port", n => { Port = n.GetIntValue(); } }, + { "sd", n => { Sd = n.GetStringValue(); } }, + { "server", n => { Server = n.GetStringValue(); } }, + { "tls", n => { Tls = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("ca", Ca); + writer.WriteStringValue("cert", Cert); + writer.WriteEnumValue("format", Format); + writer.WriteStringValue("key", Key); + writer.WriteStringValue("logline", Logline); + writer.WriteIntValue("port", Port); + writer.WriteStringValue("sd", Sd); + writer.WriteStringValue("server", Server); + writer.WriteBoolValue("tls", Tls); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Rsyslog_logsink_format.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Rsyslog_logsink_format.cs new file mode 100644 index 0000000..36b0cbe --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Rsyslog_logsink_format.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Message format used by the server, this can be either rfc3164 (the old BSD style message format), `rfc5424` (current syslog message format) or custom + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Rsyslog_logsink_format + { + [EnumMember(Value = "rfc5424")] + #pragma warning disable CS1591 + Rfc5424, + #pragma warning restore CS1591 + [EnumMember(Value = "rfc3164")] + #pragma warning disable CS1591 + Rfc3164, + #pragma warning restore CS1591 + [EnumMember(Value = "custom")] + #pragma warning disable CS1591 + Custom, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Scheduled_details.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Scheduled_details.cs new file mode 100644 index 0000000..5c988cf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Scheduled_details.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Trigger details for SCHEDULED type, where body is optional. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Scheduled_details : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Optional data to be sent to function while triggering the function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details_body? Body { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details_body Body { get; set; } +#endif + /// valid cron expression string which is required for SCHEDULED type triggers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Cron { get; set; } +#nullable restore +#else + public string Cron { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Scheduled_details() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "body", n => { Body = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details_body.CreateFromDiscriminatorValue); } }, + { "cron", n => { Cron = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("body", Body); + writer.WriteStringValue("cron", Cron); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Scheduled_details_body.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Scheduled_details_body.cs new file mode 100644 index 0000000..ce0ff30 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Scheduled_details_body.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Optional data to be sent to function while triggering the function. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Scheduled_details_body : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Scheduled_details_body() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details_body CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details_body(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Selective_destroy_associated_resource.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Selective_destroy_associated_resource.cs new file mode 100644 index 0000000..c9d1481 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Selective_destroy_associated_resource.cs @@ -0,0 +1,107 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object containing information about a resource to be scheduled for deletion. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Selective_destroy_associated_resource : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of unique identifiers for the floating IPs to be scheduled for deletion. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FloatingIps { get; set; } +#nullable restore +#else + public List FloatingIps { get; set; } +#endif + /// An array of unique identifiers for the reserved IPs to be scheduled for deletion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ReservedIps { get; set; } +#nullable restore +#else + public List ReservedIps { get; set; } +#endif + /// An array of unique identifiers for the snapshots to be scheduled for deletion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Snapshots { get; set; } +#nullable restore +#else + public List Snapshots { get; set; } +#endif + /// An array of unique identifiers for the volumes to be scheduled for deletion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Volumes { get; set; } +#nullable restore +#else + public List Volumes { get; set; } +#endif + /// An array of unique identifiers for the volume snapshots to be scheduled for deletion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VolumeSnapshots { get; set; } +#nullable restore +#else + public List VolumeSnapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Selective_destroy_associated_resource() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Selective_destroy_associated_resource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Selective_destroy_associated_resource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "floating_ips", n => { FloatingIps = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "reserved_ips", n => { ReservedIps = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "snapshots", n => { Snapshots = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "volume_snapshots", n => { VolumeSnapshots = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "volumes", n => { Volumes = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("floating_ips", FloatingIps); + writer.WriteCollectionOfPrimitiveValues("reserved_ips", ReservedIps); + writer.WriteCollectionOfPrimitiveValues("snapshots", Snapshots); + writer.WriteCollectionOfPrimitiveValues("volume_snapshots", VolumeSnapshots); + writer.WriteCollectionOfPrimitiveValues("volumes", Volumes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Simple_charge.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Simple_charge.cs new file mode 100644 index 0000000..391da07 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Simple_charge.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Simple_charge : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Total amount charged in USD +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Amount { get; set; } +#nullable restore +#else + public string Amount { get; set; } +#endif + /// Name of the charge +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Simple_charge() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Simple_charge(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "amount", n => { Amount = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("amount", Amount); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Sink_resource.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Sink_resource.cs new file mode 100644 index 0000000..055798c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Sink_resource.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Sink_resource : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// resource name +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The uniform resource name (URN) for the resource in the format do:resource_type:resource_id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Urn { get; set; } +#nullable restore +#else + public string Urn { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Sink_resource() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Sink_resource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Sink_resource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "urn", n => { Urn = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("urn", Urn); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Sinks_response.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Sinks_response.cs new file mode 100644 index 0000000..f4b23e6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Sinks_response.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Sinks_response : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The destination property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Destination? Destination { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Destination Destination { get; set; } +#endif + /// List of resources identified by their URNs. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Sinks_response() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Sinks_response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Sinks_response(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "destination", n => { Destination = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Destination.CreateFromDiscriminatorValue); } }, + { "resources", n => { Resources = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Sink_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("destination", Destination); + writer.WriteCollectionOfObjectValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Size.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Size.cs new file mode 100644 index 0000000..9ff16a7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Size.cs @@ -0,0 +1,133 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Size : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// This is a boolean value that represents whether new Droplets can be created with this size. + public bool? Available { get; set; } + /// A string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes. + public int? Disk { get; set; } + /// An array of objects containing information about the disks available to Droplets created with this size. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DiskInfo { get; set; } +#nullable restore +#else + public List DiskInfo { get; set; } +#endif + /// An object containing information about the GPU capabilities of Droplets created with this size. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info? GpuInfo { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info GpuInfo { get; set; } +#endif + /// The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes. + public int? Memory { get; set; } + /// This describes the price of the Droplet size as measured hourly. The value is measured in US dollars. + public float? PriceHourly { get; set; } + /// This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars. + public float? PriceMonthly { get; set; } + /// An array containing the region slugs where this size is available for Droplet creates. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// A human-readable string that is used to uniquely identify each size. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes. + public float? Transfer { get; set; } + /// The number of CPUs allocated to Droplets of this size. + public int? Vcpus { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Size() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Size CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Size(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "available", n => { Available = n.GetBoolValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "disk", n => { Disk = n.GetIntValue(); } }, + { "disk_info", n => { DiskInfo = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Disk_info.CreateFromDiscriminatorValue)?.AsList(); } }, + { "gpu_info", n => { GpuInfo = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Gpu_info.CreateFromDiscriminatorValue); } }, + { "memory", n => { Memory = n.GetIntValue(); } }, + { "price_hourly", n => { PriceHourly = n.GetFloatValue(); } }, + { "price_monthly", n => { PriceMonthly = n.GetFloatValue(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + { "transfer", n => { Transfer = n.GetFloatValue(); } }, + { "vcpus", n => { Vcpus = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("available", Available); + writer.WriteStringValue("description", Description); + writer.WriteIntValue("disk", Disk); + writer.WriteCollectionOfObjectValues("disk_info", DiskInfo); + writer.WriteObjectValue("gpu_info", GpuInfo); + writer.WriteIntValue("memory", Memory); + writer.WriteFloatValue("price_hourly", PriceHourly); + writer.WriteFloatValue("price_monthly", PriceMonthly); + writer.WriteCollectionOfPrimitiveValues("regions", Regions); + writer.WriteStringValue("slug", Slug); + writer.WriteFloatValue("transfer", Transfer); + writer.WriteIntValue("vcpus", Vcpus); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Slack_details.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Slack_details.cs new file mode 100644 index 0000000..12d5717 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Slack_details.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Slack_details : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Slack channel to notify of an alert trigger. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Channel { get; set; } +#nullable restore +#else + public string Channel { get; set; } +#endif + /// Slack Webhook URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Slack_details() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Slack_details CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Slack_details(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "channel", n => { Channel = n.GetStringValue(); } }, + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("channel", Channel); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots.cs new file mode 100644 index 0000000..48b4c23 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots.cs @@ -0,0 +1,80 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Snapshots : global::InfinityFlow.DigitalOcean.Client.Models.Snapshots_base, IParsable + #pragma warning restore CS1591 + { + /// The unique identifier for the snapshot. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The unique identifier for the resource that the snapshot originated from. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ResourceId { get; set; } +#nullable restore +#else + public string ResourceId { get; set; } +#endif + /// The type of resource that the snapshot originated from. + public global::InfinityFlow.DigitalOcean.Client.Models.Snapshots_resource_type? ResourceType { get; set; } + /// An array of Tags the snapshot has been tagged with. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Snapshots CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Snapshots(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "id", n => { Id = n.GetStringValue(); } }, + { "resource_id", n => { ResourceId = n.GetStringValue(); } }, + { "resource_type", n => { ResourceType = n.GetEnumValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("resource_id", ResourceId); + writer.WriteEnumValue("resource_type", ResourceType); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots_base.cs new file mode 100644 index 0000000..5982bc7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots_base.cs @@ -0,0 +1,87 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Snapshots_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the snapshot was created. + public DateTimeOffset? CreatedAt { get; set; } + /// The minimum size in GB required for a volume or Droplet to use this snapshot. + public int? MinDiskSize { get; set; } + /// A human-readable name for the snapshot. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// The billable size of the snapshot in gigabytes. + public float? SizeGigabytes { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Snapshots_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Snapshots_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Snapshots_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "min_disk_size", n => { MinDiskSize = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "regions", n => { Regions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "size_gigabytes", n => { SizeGigabytes = n.GetFloatValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteIntValue("min_disk_size", MinDiskSize); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfPrimitiveValues("regions", Regions); + writer.WriteFloatValue("size_gigabytes", SizeGigabytes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots_resource_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots_resource_type.cs new file mode 100644 index 0000000..67aa7a4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Snapshots_resource_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of resource that the snapshot originated from. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Snapshots_resource_type + { + [EnumMember(Value = "droplet")] + #pragma warning disable CS1591 + Droplet, + #pragma warning restore CS1591 + [EnumMember(Value = "volume")] + #pragma warning disable CS1591 + Volume, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Source_database.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Source_database.cs new file mode 100644 index 0000000..152c852 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Source_database.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Source_database : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Enables SSL encryption when connecting to the source database. + public bool? DisableSsl { get; set; } + /// List of databases that should be ignored during migration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? IgnoreDbs { get; set; } +#nullable restore +#else + public List IgnoreDbs { get; set; } +#endif + /// The source property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Source_database_source? Source { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Source_database_source Source { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Source_database() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Source_database CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Source_database(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "disable_ssl", n => { DisableSsl = n.GetBoolValue(); } }, + { "ignore_dbs", n => { IgnoreDbs = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "source", n => { Source = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Source_database_source.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("disable_ssl", DisableSsl); + writer.WriteCollectionOfPrimitiveValues("ignore_dbs", IgnoreDbs); + writer.WriteObjectValue("source", Source); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Source_database_source.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Source_database_source.cs new file mode 100644 index 0000000..4813265 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Source_database_source.cs @@ -0,0 +1,99 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Source_database_source : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the default database. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Dbname { get; set; } +#nullable restore +#else + public string Dbname { get; set; } +#endif + /// The FQDN pointing to the database cluster's current primary node. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Host { get; set; } +#nullable restore +#else + public string Host { get; set; } +#endif + /// The randomly generated password for the default user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// The port on which the database cluster is listening. + public int? Port { get; set; } + /// The default user for the database. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Source_database_source() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Source_database_source CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Source_database_source(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "dbname", n => { Dbname = n.GetStringValue(); } }, + { "host", n => { Host = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "port", n => { Port = n.GetIntValue(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("dbname", Dbname); + writer.WriteStringValue("host", Host); + writer.WriteStringValue("password", Password); + writer.WriteIntValue("port", Port); + writer.WriteStringValue("username", Username); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Sql_mode.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Sql_mode.cs new file mode 100644 index 0000000..292e69d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Sql_mode.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Sql_mode : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A string specifying the configured SQL modes for the MySQL cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SqlMode { get; set; } +#nullable restore +#else + public string SqlMode { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Sql_mode() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Sql_mode CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Sql_mode(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sql_mode", n => { SqlMode = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("sql_mode", SqlMode); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/SshKeys.cs b/src/InfinityFlow.DigitalOcean.Client/Models/SshKeys.cs new file mode 100644 index 0000000..1074742 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/SshKeys.cs @@ -0,0 +1,87 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SshKeys : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Fingerprint { get; private set; } +#nullable restore +#else + public string Fingerprint { get; private set; } +#endif + /// A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. + public int? Id { get; private set; } + /// A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PublicKey { get; set; } +#nullable restore +#else + public string PublicKey { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SshKeys() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.SshKeys CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.SshKeys(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fingerprint", n => { Fingerprint = n.GetStringValue(); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "public_key", n => { PublicKey = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("public_key", PublicKey); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/State.cs b/src/InfinityFlow.DigitalOcean.Client/Models/State.cs new file mode 100644 index 0000000..e84ac6c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/State.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class State : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The previous_outage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Previous_outage? PreviousOutage { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Previous_outage PreviousOutage { get; set; } +#endif + /// A map of region to regional state +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Regional_state? Regions { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Regional_state Regions { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public State() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.State CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.State(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "previous_outage", n => { PreviousOutage = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Previous_outage.CreateFromDiscriminatorValue); } }, + { "regions", n => { Regions = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Regional_state.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("previous_outage", PreviousOutage); + writer.WriteObjectValue("regions", Regions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Sticky_sessions.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Sticky_sessions.cs new file mode 100644 index 0000000..75879c8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Sticky_sessions.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An object specifying sticky sessions settings for the load balancer. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Sticky_sessions : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CookieName { get; set; } +#nullable restore +#else + public string CookieName { get; set; } +#endif + /// The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. + public int? CookieTtlSeconds { get; set; } + /// An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. + public global::InfinityFlow.DigitalOcean.Client.Models.Sticky_sessions_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Sticky_sessions() + { + AdditionalData = new Dictionary(); + Type = global::InfinityFlow.DigitalOcean.Client.Models.Sticky_sessions_type.None; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Sticky_sessions CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Sticky_sessions(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cookie_name", n => { CookieName = n.GetStringValue(); } }, + { "cookie_ttl_seconds", n => { CookieTtlSeconds = n.GetIntValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("cookie_name", CookieName); + writer.WriteIntValue("cookie_ttl_seconds", CookieTtlSeconds); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Sticky_sessions_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Sticky_sessions_type.cs new file mode 100644 index 0000000..7354cb9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Sticky_sessions_type.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Sticky_sessions_type + { + [EnumMember(Value = "cookies")] + #pragma warning disable CS1591 + Cookies, + #pragma warning restore CS1591 + [EnumMember(Value = "none")] + #pragma warning disable CS1591 + None, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Subscription.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Subscription.cs new file mode 100644 index 0000000..3ab2396 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Subscription.cs @@ -0,0 +1,71 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Subscription : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The time at which the subscription was created. + public DateTimeOffset? CreatedAt { get; private set; } + /// The tier property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription_tier_base? Tier { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription_tier_base Tier { get; set; } +#endif + /// The time at which the subscription was last updated. + public DateTimeOffset? UpdatedAt { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public Subscription() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Subscription CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Subscription(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "tier", n => { Tier = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Subscription_tier_base.CreateFromDiscriminatorValue); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("tier", Tier); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Subscription_tier_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Subscription_tier_base.cs new file mode 100644 index 0000000..e30b9cd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Subscription_tier_base.cs @@ -0,0 +1,99 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Subscription_tier_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean indicating whether the subscription tier supports additional storage above what is included in the base plan at an additional cost per GiB used. + public bool? AllowStorageOverage { get; set; } + /// The amount of outbound data transfer included in the subscription tier in bytes. + public int? IncludedBandwidthBytes { get; set; } + /// The number of repositories included in the subscription tier. `0` indicates that the subscription tier includes unlimited repositories. + public int? IncludedRepositories { get; set; } + /// The amount of storage included in the subscription tier in bytes. + public int? IncludedStorageBytes { get; set; } + /// The monthly cost of the subscription tier in cents. + public int? MonthlyPriceInCents { get; set; } + /// The name of the subscription tier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The slug identifier of the subscription tier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// The price paid in cents per GiB for additional storage beyond what is included in the subscription plan. + public int? StorageOveragePriceInCents { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Subscription_tier_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Subscription_tier_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Subscription_tier_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allow_storage_overage", n => { AllowStorageOverage = n.GetBoolValue(); } }, + { "included_bandwidth_bytes", n => { IncludedBandwidthBytes = n.GetIntValue(); } }, + { "included_repositories", n => { IncludedRepositories = n.GetIntValue(); } }, + { "included_storage_bytes", n => { IncludedStorageBytes = n.GetIntValue(); } }, + { "monthly_price_in_cents", n => { MonthlyPriceInCents = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + { "storage_overage_price_in_cents", n => { StorageOveragePriceInCents = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("allow_storage_overage", AllowStorageOverage); + writer.WriteIntValue("included_bandwidth_bytes", IncludedBandwidthBytes); + writer.WriteIntValue("included_repositories", IncludedRepositories); + writer.WriteIntValue("included_storage_bytes", IncludedStorageBytes); + writer.WriteIntValue("monthly_price_in_cents", MonthlyPriceInCents); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("slug", Slug); + writer.WriteIntValue("storage_overage_price_in_cents", StorageOveragePriceInCents); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Supported_droplet_backup_policy.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Supported_droplet_backup_policy.cs new file mode 100644 index 0000000..5037379 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Supported_droplet_backup_policy.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Supported_droplet_backup_policy : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the Droplet backup plan. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The day of the week the backup will occur. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PossibleDays { get; set; } +#nullable restore +#else + public List PossibleDays { get; set; } +#endif + /// An array of integers representing the hours of the day that a backup canstart. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PossibleWindowStarts { get; set; } +#nullable restore +#else + public List PossibleWindowStarts { get; set; } +#endif + /// The number of days that a backup will be kept. + public int? RetentionPeriodDays { get; set; } + /// The number of hours that a backup window is open. + public int? WindowLengthHours { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Supported_droplet_backup_policy() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Supported_droplet_backup_policy CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Supported_droplet_backup_policy(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "possible_days", n => { PossibleDays = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "possible_window_starts", n => { PossibleWindowStarts = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "retention_period_days", n => { RetentionPeriodDays = n.GetIntValue(); } }, + { "window_length_hours", n => { WindowLengthHours = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfPrimitiveValues("possible_days", PossibleDays); + writer.WriteCollectionOfPrimitiveValues("possible_window_starts", PossibleWindowStarts); + writer.WriteIntValue("retention_period_days", RetentionPeriodDays); + writer.WriteIntValue("window_length_hours", WindowLengthHours); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Tags.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Tags.cs new file mode 100644 index 0000000..b27060b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Tags.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// A tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it.Tags have two attributes: a user defined `name` attribute and an embedded `resources` attribute with information about resources that have been tagged. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Tags : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores.There is a limit of 255 characters per tag.**Note:** Tag names are case stable, which means the capitalization you use when you first create a tag is canonical.When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be `https://api.digitalocean.com/v2/tags/PROD/resources` (not `/v2/tags/prod/resources`).Tagged resources in the control panel will always display the canonical capitalization. For example, if you create a tag named "PROD", you can tag resources in the control panel by entering "prod". The tag will still display with its canonical capitalization, "PROD". +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An embedded object containing key value pairs of resource type and resource statistics. It also includes a count of the total number of resources tagged with the current tag as well as a `last_tagged_uri` attribute set to the last resource tagged with the current tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_resources? Resources { get; private set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_resources Resources { get; private set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Tags() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Tags CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Tags(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "resources", n => { Resources = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resources.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Tags_metadata.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_metadata.cs new file mode 100644 index 0000000..35eca0f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_metadata.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// Tagged Resource Statistics include metadata regarding the resource type that has been tagged. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Tags_metadata : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of tagged objects for this type of resource. + public int? Count { get; set; } + /// The URI for the last tagged object for this type of resource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastTaggedUri { get; set; } +#nullable restore +#else + public string LastTaggedUri { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Tags_metadata() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "count", n => { Count = n.GetIntValue(); } }, + { "last_tagged_uri", n => { LastTaggedUri = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("count", Count); + writer.WriteStringValue("last_tagged_uri", LastTaggedUri); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource.cs new file mode 100644 index 0000000..535ce83 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Tags_resource : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of objects containing resource_id and resource_type attributes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Tags_resource() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "resources", n => { Resources = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource_resources.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource_resources.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource_resources.cs new file mode 100644 index 0000000..4240282 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource_resources.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Tags_resource_resources : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The identifier of a resource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ResourceId { get; set; } +#nullable restore +#else + public string ResourceId { get; set; } +#endif + /// The type of the resource. + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource_resources_resource_type? ResourceType { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Tags_resource_resources() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource_resources CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource_resources(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "resource_id", n => { ResourceId = n.GetStringValue(); } }, + { "resource_type", n => { ResourceType = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("resource_id", ResourceId); + writer.WriteEnumValue("resource_type", ResourceType); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource_resources_resource_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource_resources_resource_type.cs new file mode 100644 index 0000000..db1d663 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resource_resources_resource_type.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The type of the resource. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Tags_resource_resources_resource_type + { + [EnumMember(Value = "droplet")] + #pragma warning disable CS1591 + Droplet, + #pragma warning restore CS1591 + [EnumMember(Value = "image")] + #pragma warning disable CS1591 + Image, + #pragma warning restore CS1591 + [EnumMember(Value = "volume")] + #pragma warning disable CS1591 + Volume, + #pragma warning restore CS1591 + [EnumMember(Value = "volume_snapshot")] + #pragma warning disable CS1591 + Volume_snapshot, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resources.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resources.cs new file mode 100644 index 0000000..b9addf3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Tags_resources.cs @@ -0,0 +1,97 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// An embedded object containing key value pairs of resource type and resource statistics. It also includes a count of the total number of resources tagged with the current tag as well as a `last_tagged_uri` attribute set to the last resource tagged with the current tag. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Tags_resources : global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata, IParsable + { + /// Tagged Resource Statistics include metadata regarding the resource type that has been tagged. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata? Databases { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata Databases { get; set; } +#endif + /// Tagged Resource Statistics include metadata regarding the resource type that has been tagged. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata? Droplets { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata Droplets { get; set; } +#endif + /// Tagged Resource Statistics include metadata regarding the resource type that has been tagged. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata? Imgages { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata Imgages { get; set; } +#endif + /// Tagged Resource Statistics include metadata regarding the resource type that has been tagged. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata? Volumes { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata Volumes { get; set; } +#endif + /// Tagged Resource Statistics include metadata regarding the resource type that has been tagged. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata? VolumeSnapshots { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata VolumeSnapshots { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Tags_resources CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Tags_resources(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "databases", n => { Databases = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata.CreateFromDiscriminatorValue); } }, + { "droplets", n => { Droplets = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata.CreateFromDiscriminatorValue); } }, + { "imgages", n => { Imgages = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata.CreateFromDiscriminatorValue); } }, + { "volume_snapshots", n => { VolumeSnapshots = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata.CreateFromDiscriminatorValue); } }, + { "volumes", n => { Volumes = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags_metadata.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("databases", Databases); + writer.WriteObjectValue("droplets", Droplets); + writer.WriteObjectValue("imgages", Imgages); + writer.WriteObjectValue("volume_snapshots", VolumeSnapshots); + writer.WriteObjectValue("volumes", Volumes); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Timescaledb_advanced_config.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Timescaledb_advanced_config.cs new file mode 100644 index 0000000..864fc7f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Timescaledb_advanced_config.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// + /// TimescaleDB extension configuration values + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Timescaledb_advanced_config : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of background workers for timescaledb operations. Set to the sum of your number of databases and the total number of concurrent background workers you want running at any given point in time. + public int? MaxBackgroundWorkers { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Timescaledb_advanced_config() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Timescaledb_advanced_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Timescaledb_advanced_config(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "max_background_workers", n => { MaxBackgroundWorkers = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("max_background_workers", MaxBackgroundWorkers); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Trigger_info.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Trigger_info.cs new file mode 100644 index 0000000..468a693 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Trigger_info.cs @@ -0,0 +1,139 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Trigger_info : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// UTC time string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; set; } +#nullable restore +#else + public string CreatedAt { get; set; } +#endif + /// Name of function(action) that exists in the given namespace. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Function { get; set; } +#nullable restore +#else + public string Function { get; set; } +#endif + /// Indicates weather the trigger is paused or unpaused. + public bool? IsEnabled { get; set; } + /// The trigger's unique name within the namespace. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A unique string format of UUID with a prefix fn-. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Namespace { get; set; } +#nullable restore +#else + public string Namespace { get; set; } +#endif + /// Trigger details for SCHEDULED type, where body is optional. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details? ScheduledDetails { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details ScheduledDetails { get; set; } +#endif + /// The scheduled_runs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info_scheduled_runs? ScheduledRuns { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info_scheduled_runs ScheduledRuns { get; set; } +#endif + /// String which indicates the type of trigger source like SCHEDULED. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// UTC time string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UpdatedAt { get; set; } +#nullable restore +#else + public string UpdatedAt { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Trigger_info() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "function", n => { Function = n.GetStringValue(); } }, + { "is_enabled", n => { IsEnabled = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "namespace", n => { Namespace = n.GetStringValue(); } }, + { "scheduled_details", n => { ScheduledDetails = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details.CreateFromDiscriminatorValue); } }, + { "scheduled_runs", n => { ScheduledRuns = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info_scheduled_runs.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetStringValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("created_at", CreatedAt); + writer.WriteStringValue("function", Function); + writer.WriteBoolValue("is_enabled", IsEnabled); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("namespace", Namespace); + writer.WriteObjectValue("scheduled_details", ScheduledDetails); + writer.WriteObjectValue("scheduled_runs", ScheduledRuns); + writer.WriteStringValue("type", Type); + writer.WriteStringValue("updated_at", UpdatedAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Trigger_info_scheduled_runs.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Trigger_info_scheduled_runs.cs new file mode 100644 index 0000000..4510cc6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Trigger_info_scheduled_runs.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Trigger_info_scheduled_runs : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Indicates last run time. null value indicates trigger not run yet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastRunAt { get; set; } +#nullable restore +#else + public string LastRunAt { get; set; } +#endif + /// Indicates next run time. null value indicates trigger will not run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NextRunAt { get; set; } +#nullable restore +#else + public string NextRunAt { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Trigger_info_scheduled_runs() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info_scheduled_runs CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info_scheduled_runs(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "last_run_at", n => { LastRunAt = n.GetStringValue(); } }, + { "next_run_at", n => { NextRunAt = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("last_run_at", LastRunAt); + writer.WriteStringValue("next_run_at", NextRunAt); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Update_endpoint.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Update_endpoint.cs new file mode 100644 index 0000000..e8eb644 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Update_endpoint.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Update_endpoint : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. + public Guid? CertificateId { get; set; } + /// The fully qualified domain name (FQDN) of the custom subdomain used with the CDN endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CustomDomain { get; set; } +#nullable restore +#else + public string CustomDomain { get; set; } +#endif + /// The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. + public int? Ttl { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Update_endpoint() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate_id", n => { CertificateId = n.GetGuidValue(); } }, + { "custom_domain", n => { CustomDomain = n.GetStringValue(); } }, + { "ttl", n => { Ttl = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("certificate_id", CertificateId); + writer.WriteStringValue("custom_domain", CustomDomain); + writer.WriteIntValue("ttl", Ttl); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Update_registry.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Update_registry.cs new file mode 100644 index 0000000..89a6874 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Update_registry.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Update_registry : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating that the garbage collection should be cancelled. + public bool? Cancel { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Update_registry() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Update_registry CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Update_registry(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cancel", n => { Cancel = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("cancel", Cancel); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Update_trigger.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Update_trigger.cs new file mode 100644 index 0000000..e95f7be --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Update_trigger.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Update_trigger : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Indicates weather the trigger is paused or unpaused. + public bool? IsEnabled { get; set; } + /// Trigger details for SCHEDULED type, where body is optional. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details? ScheduledDetails { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details ScheduledDetails { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Update_trigger() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "is_enabled", n => { IsEnabled = n.GetBoolValue(); } }, + { "scheduled_details", n => { ScheduledDetails = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Scheduled_details.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("is_enabled", IsEnabled); + writer.WriteObjectValue("scheduled_details", ScheduledDetails); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/User.cs b/src/InfinityFlow.DigitalOcean.Client/Models/User.cs new file mode 100644 index 0000000..fec0c6c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/User.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class User : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kubernetes_cluster_user property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.User_kubernetes_cluster_user? KubernetesClusterUser { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.User_kubernetes_cluster_user KubernetesClusterUser { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public User() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.User CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.User(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kubernetes_cluster_user", n => { KubernetesClusterUser = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.User_kubernetes_cluster_user.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("kubernetes_cluster_user", KubernetesClusterUser); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/User_kubernetes_cluster_user.cs b/src/InfinityFlow.DigitalOcean.Client/Models/User_kubernetes_cluster_user.cs new file mode 100644 index 0000000..ea36f05 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/User_kubernetes_cluster_user.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class User_kubernetes_cluster_user : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of in-cluster groups that the user belongs to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Groups { get; set; } +#nullable restore +#else + public List Groups { get; set; } +#endif + /// The username for the cluster admin user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public User_kubernetes_cluster_user() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.User_kubernetes_cluster_user CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.User_kubernetes_cluster_user(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "groups", n => { Groups = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("groups", Groups); + writer.WriteStringValue("username", Username); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/User_settings.cs b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings.cs new file mode 100644 index 0000000..904e07d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class User_settings : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// ACLs (Access Control Lists) specifying permissions on topics within a Kafka cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Acl { get; set; } +#nullable restore +#else + public List Acl { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// ACLs (Access Control Lists) specifying permissions on index within a OpenSearch cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? OpensearchAcl { get; set; } +#nullable restore +#else + public List OpensearchAcl { get; set; } +#endif + /// For Postgres clusters, set to `true` for a user with replication rights.This option is not currently supported for other database engines. + public bool? PgAllowReplication { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public User_settings() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.User_settings CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.User_settings(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "acl", n => { Acl = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.User_settings_acl.CreateFromDiscriminatorValue)?.AsList(); } }, + { "opensearch_acl", n => { OpensearchAcl = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.User_settings_opensearch_acl.CreateFromDiscriminatorValue)?.AsList(); } }, + { "pg_allow_replication", n => { PgAllowReplication = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("acl", Acl); + writer.WriteCollectionOfObjectValues("opensearch_acl", OpensearchAcl); + writer.WriteBoolValue("pg_allow_replication", PgAllowReplication); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_acl.cs b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_acl.cs new file mode 100644 index 0000000..ff669cc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_acl.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class User_settings_acl : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An identifier for the ACL. Will be computed after the ACL is created/updated. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to the topic. 'produceconsume' allows for both 'consume' and 'produce' permission. 'admin' allows for 'produceconsume' as well as any operations to administer the topic (delete, update). + public global::InfinityFlow.DigitalOcean.Client.Models.User_settings_acl_permission? Permission { get; set; } + /// A regex for matching the topic(s) that this ACL should apply to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Topic { get; set; } +#nullable restore +#else + public string Topic { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public User_settings_acl() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.User_settings_acl CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.User_settings_acl(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "permission", n => { Permission = n.GetEnumValue(); } }, + { "topic", n => { Topic = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("permission", Permission); + writer.WriteStringValue("topic", Topic); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_acl_permission.cs b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_acl_permission.cs new file mode 100644 index 0000000..2cd908a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_acl_permission.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to the topic. 'produceconsume' allows for both 'consume' and 'produce' permission. 'admin' allows for 'produceconsume' as well as any operations to administer the topic (delete, update). + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum User_settings_acl_permission + { + [EnumMember(Value = "admin")] + #pragma warning disable CS1591 + Admin, + #pragma warning restore CS1591 + [EnumMember(Value = "consume")] + #pragma warning disable CS1591 + Consume, + #pragma warning restore CS1591 + [EnumMember(Value = "produce")] + #pragma warning disable CS1591 + Produce, + #pragma warning restore CS1591 + [EnumMember(Value = "produceconsume")] + #pragma warning disable CS1591 + Produceconsume, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_opensearch_acl.cs b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_opensearch_acl.cs new file mode 100644 index 0000000..ab6a957 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_opensearch_acl.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class User_settings_opensearch_acl : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A regex for matching the indexes that this ACL should apply to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Index { get; set; } +#nullable restore +#else + public string Index { get; set; } +#endif + /// Permission set applied to the ACL. 'read' allows user to read from the index. 'write' allows for user to write to the index. 'readwrite' allows for both 'read' and 'write' permission. 'deny'(default) restricts user from performing any operation over an index. 'admin' allows for 'readwrite' as well as any operations to administer the index. + public global::InfinityFlow.DigitalOcean.Client.Models.User_settings_opensearch_acl_permission? Permission { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public User_settings_opensearch_acl() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.User_settings_opensearch_acl CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.User_settings_opensearch_acl(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "index", n => { Index = n.GetStringValue(); } }, + { "permission", n => { Permission = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("index", Index); + writer.WriteEnumValue("permission", Permission); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_opensearch_acl_permission.cs b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_opensearch_acl_permission.cs new file mode 100644 index 0000000..dbd059a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/User_settings_opensearch_acl_permission.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// Permission set applied to the ACL. 'read' allows user to read from the index. 'write' allows for user to write to the index. 'readwrite' allows for both 'read' and 'write' permission. 'deny'(default) restricts user from performing any operation over an index. 'admin' allows for 'readwrite' as well as any operations to administer the index. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum User_settings_opensearch_acl_permission + { + [EnumMember(Value = "deny")] + #pragma warning disable CS1591 + Deny, + #pragma warning restore CS1591 + [EnumMember(Value = "admin")] + #pragma warning disable CS1591 + Admin, + #pragma warning restore CS1591 + [EnumMember(Value = "read")] + #pragma warning disable CS1591 + Read, + #pragma warning restore CS1591 + [EnumMember(Value = "readwrite")] + #pragma warning disable CS1591 + Readwrite, + #pragma warning restore CS1591 + [EnumMember(Value = "write")] + #pragma warning disable CS1591 + Write, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Validate_registry.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Validate_registry.cs new file mode 100644 index 0000000..ca95cea --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Validate_registry.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Validate_registry : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and `-`, up to a limit of 63 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Validate_registry() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Validate_registry CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Validate_registry(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Version2.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Version2.cs new file mode 100644 index 0000000..6f1a555 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Version2.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Version2 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A string representing the version of the database engine in use for the cluster. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Version2() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Version2 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Version2(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("version", Version); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/VolumeAction.cs b/src/InfinityFlow.DigitalOcean.Client/Models/VolumeAction.cs new file mode 100644 index 0000000..03650a4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/VolumeAction.cs @@ -0,0 +1,46 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VolumeAction : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_attach.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_attach.cs new file mode 100644 index 0000000..a52f7ac --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_attach.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volume_action_post_attach : global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_base, IParsable + #pragma warning restore CS1591 + { + /// The unique identifier for the Droplet the volume will be attached or detached from. + public int? DropletId { get; set; } + /// A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("droplet_id", DropletId); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_base.cs new file mode 100644 index 0000000..70de470 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_base.cs @@ -0,0 +1,63 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volume_action_post_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The slug identifier for the region where the resource will initially be available. + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? Region { get; set; } + /// The volume action to initiate. + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_base_type? Type { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Volume_action_post_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "region", n => { Region = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("region", Region); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_base_type.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_base_type.cs new file mode 100644 index 0000000..0be9978 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_base_type.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The volume action to initiate. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Volume_action_post_base_type + { + [EnumMember(Value = "attach")] + #pragma warning disable CS1591 + Attach, + #pragma warning restore CS1591 + [EnumMember(Value = "detach")] + #pragma warning disable CS1591 + Detach, + #pragma warning restore CS1591 + [EnumMember(Value = "resize")] + #pragma warning disable CS1591 + Resize, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_detach.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_detach.cs new file mode 100644 index 0000000..d071a51 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_detach.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volume_action_post_detach : global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_base, IParsable + #pragma warning restore CS1591 + { + /// The unique identifier for the Droplet the volume will be attached or detached from. + public int? DropletId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "droplet_id", n => { DropletId = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("droplet_id", DropletId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_resize.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_resize.cs new file mode 100644 index 0000000..0eb9863 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_action_post_resize.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volume_action_post_resize : global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_base, IParsable + #pragma warning restore CS1591 + { + /// The new size of the block storage volume in GiB (1024^3). + public int? SizeGigabytes { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_resize CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_resize(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "size_gigabytes", n => { SizeGigabytes = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteIntValue("size_gigabytes", SizeGigabytes); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volume_base.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_base.cs new file mode 100644 index 0000000..37643d0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_base.cs @@ -0,0 +1,116 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volume_base : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the block storage volume was created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; private set; } +#nullable restore +#else + public string CreatedAt { get; private set; } +#endif + /// An optional free-form text field to describe a block storage volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// An array containing the IDs of the Droplets the volume is attached to. Note that at this time, a volume can only be attached to a single Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; private set; } +#nullable restore +#else + public List DropletIds { get; private set; } +#endif + /// The unique identifier for the block storage volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; private set; } +#nullable restore +#else + public string Id { get; private set; } +#endif + /// A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot. + public int? SizeGigabytes { get; set; } + /// A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Volume_base() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Volume_base CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volume_base(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "size_gigabytes", n => { SizeGigabytes = n.GetIntValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("name", Name); + writer.WriteIntValue("size_gigabytes", SizeGigabytes); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volume_full.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_full.cs new file mode 100644 index 0000000..3746104 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volume_full.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volume_full : global::InfinityFlow.DigitalOcean.Client.Models.Volume_base, IParsable + #pragma warning restore CS1591 + { + /// The label currently applied to the filesystem. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FilesystemLabel { get; set; } +#nullable restore +#else + public string FilesystemLabel { get; set; } +#endif + /// The type of filesystem currently in-use on the volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FilesystemType { get; set; } +#nullable restore +#else + public string FilesystemType { get; set; } +#endif + /// The region property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Region? Region { get; private set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Region Region { get; private set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.Models.Volume_full CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volume_full(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "filesystem_label", n => { FilesystemLabel = n.GetStringValue(); } }, + { "filesystem_type", n => { FilesystemType = n.GetStringValue(); } }, + { "region", n => { Region = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Region.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteStringValue("filesystem_label", FilesystemLabel); + writer.WriteStringValue("filesystem_type", FilesystemType); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volumes_ext4.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volumes_ext4.cs new file mode 100644 index 0000000..b0a488d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volumes_ext4.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volumes_ext4 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the block storage volume was created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; private set; } +#nullable restore +#else + public string CreatedAt { get; private set; } +#endif + /// An optional free-form text field to describe a block storage volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// An array containing the IDs of the Droplets the volume is attached to. Note that at this time, a volume can only be attached to a single Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; private set; } +#nullable restore +#else + public List DropletIds { get; private set; } +#endif + /// The filesystem_label property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FilesystemLabel { get; set; } +#nullable restore +#else + public string FilesystemLabel { get; set; } +#endif + /// The name of the filesystem type to be used on the volume. When provided, the volume will automatically be formatted to the specified filesystem type. Currently, the available options are `ext4` and `xfs`. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to other Droplets is not recommended. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FilesystemType { get; set; } +#nullable restore +#else + public string FilesystemType { get; set; } +#endif + /// The unique identifier for the block storage volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; private set; } +#nullable restore +#else + public string Id { get; private set; } +#endif + /// A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The slug identifier for the region where the resource will initially be available. + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? Region { get; set; } + /// The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot. + public int? SizeGigabytes { get; set; } + /// The unique identifier for the volume snapshot from which to create the volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SnapshotId { get; set; } +#nullable restore +#else + public string SnapshotId { get; set; } +#endif + /// A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Volumes_ext4() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Volumes_ext4 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volumes_ext4(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "filesystem_label", n => { FilesystemLabel = n.GetStringValue(); } }, + { "filesystem_type", n => { FilesystemType = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "region", n => { Region = n.GetEnumValue(); } }, + { "size_gigabytes", n => { SizeGigabytes = n.GetIntValue(); } }, + { "snapshot_id", n => { SnapshotId = n.GetStringValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("filesystem_label", FilesystemLabel); + writer.WriteStringValue("filesystem_type", FilesystemType); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("region", Region); + writer.WriteIntValue("size_gigabytes", SizeGigabytes); + writer.WriteStringValue("snapshot_id", SnapshotId); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Volumes_xfs.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Volumes_xfs.cs new file mode 100644 index 0000000..8383918 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Volumes_xfs.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Volumes_xfs : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the block storage volume was created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; private set; } +#nullable restore +#else + public string CreatedAt { get; private set; } +#endif + /// An optional free-form text field to describe a block storage volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// An array containing the IDs of the Droplets the volume is attached to. Note that at this time, a volume can only be attached to a single Droplet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; private set; } +#nullable restore +#else + public List DropletIds { get; private set; } +#endif + /// The filesystem_label property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FilesystemLabel { get; set; } +#nullable restore +#else + public string FilesystemLabel { get; set; } +#endif + /// The name of the filesystem type to be used on the volume. When provided, the volume will automatically be formatted to the specified filesystem type. Currently, the available options are `ext4` and `xfs`. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to other Droplets is not recommended. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FilesystemType { get; set; } +#nullable restore +#else + public string FilesystemType { get; set; } +#endif + /// The unique identifier for the block storage volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; private set; } +#nullable restore +#else + public string Id { get; private set; } +#endif + /// A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The slug identifier for the region where the resource will initially be available. + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? Region { get; set; } + /// The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot. + public int? SizeGigabytes { get; set; } + /// The unique identifier for the volume snapshot from which to create the volume. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SnapshotId { get; set; } +#nullable restore +#else + public string SnapshotId { get; set; } +#endif + /// A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Volumes_xfs() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Volumes_xfs CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Volumes_xfs(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "filesystem_label", n => { FilesystemLabel = n.GetStringValue(); } }, + { "filesystem_type", n => { FilesystemType = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "region", n => { Region = n.GetEnumValue(); } }, + { "size_gigabytes", n => { SizeGigabytes = n.GetIntValue(); } }, + { "snapshot_id", n => { SnapshotId = n.GetStringValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("filesystem_label", FilesystemLabel); + writer.WriteStringValue("filesystem_type", FilesystemType); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("region", Region); + writer.WriteIntValue("size_gigabytes", SizeGigabytes); + writer.WriteStringValue("snapshot_id", SnapshotId); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Vpc.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc.cs new file mode 100644 index 0000000..3cfc557 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format. + public DateTimeOffset? CreatedAt { get; private set; } + /// A boolean value indicating whether or not the VPC is the default network for the region. All applicable resources are placed into the default VPC network unless otherwise specified during their creation. The `default` field cannot be unset from `true`. If you want to set a new default VPC network, update the `default` field of another VPC network in the same region. The previous network's `default` field will be set to `false` when a new default VPC has been defined. + public bool? Default { get; set; } + /// A free-form text field for describing the VPC's purpose. It may be a maximum of 255 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// A unique ID that can be used to identify and reference the VPC. + public Guid? Id { get; private set; } + /// The range of IP addresses in the VPC in CIDR notation. Network ranges cannot overlap with other networks in the same account and must be in range of private addresses as defined in RFC1918. It may not be smaller than `/28` nor larger than `/16`. If no IP range is specified, a `/20` network range is generated that won't conflict with other VPC networks in your account. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IpRange { get; set; } +#nullable restore +#else + public string IpRange { get; set; } +#endif + /// The name of the VPC. Must be unique and may only contain alphanumeric characters, dashes, and periods. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The slug identifier for the region where the VPC will be created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// The uniform resource name (URN) for the resource in the format do:resource_type:resource_id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Urn { get; set; } +#nullable restore +#else + public string Urn { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Vpc() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Vpc CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Vpc(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "default", n => { Default = n.GetBoolValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "ip_range", n => { IpRange = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + { "urn", n => { Urn = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("default", Default); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("ip_range", IpRange); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("region", Region); + writer.WriteStringValue("urn", Urn); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_member.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_member.cs new file mode 100644 index 0000000..fa8b965 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_member.cs @@ -0,0 +1,85 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc_member : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format that represents when the resource was created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CreatedAt { get; set; } +#nullable restore +#else + public string CreatedAt { get; set; } +#endif + /// The name of the resource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The uniform resource name (URN) for the resource in the format do:resource_type:resource_id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Urn { get; set; } +#nullable restore +#else + public string Urn { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Vpc_member() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Vpc_member CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Vpc_member(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "urn", n => { Urn = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("created_at", CreatedAt); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("urn", Urn); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering.cs new file mode 100644 index 0000000..3c67a2f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering.cs @@ -0,0 +1,84 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc_peering : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A time value given in ISO8601 combined date and time format. + public DateTimeOffset? CreatedAt { get; private set; } + /// A unique ID that can be used to identify and reference the VPC peering. + public Guid? Id { get; private set; } + /// The name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The current status of the VPC peering. + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering_status? Status { get; private set; } + /// An array of the two peered VPCs IDs. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VpcIds { get; set; } +#nullable restore +#else + public List VpcIds { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Vpc_peering() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "id", n => { Id = n.GetGuidValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "vpc_ids", n => { VpcIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfPrimitiveValues("vpc_ids", VpcIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering_status.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering_status.cs new file mode 100644 index 0000000..a914cd4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering_status.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + /// The current status of the VPC peering. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum Vpc_peering_status + { + [EnumMember(Value = "PROVISIONING")] + #pragma warning disable CS1591 + PROVISIONING, + #pragma warning restore CS1591 + [EnumMember(Value = "ACTIVE")] + #pragma warning disable CS1591 + ACTIVE, + #pragma warning restore CS1591 + [EnumMember(Value = "DELETING")] + #pragma warning disable CS1591 + DELETING, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering_updatable.cs b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering_updatable.cs new file mode 100644 index 0000000..6916327 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/Models/Vpc_peering_updatable.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc_peering_updatable : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Vpc_peering_updatable() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering_updatable CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering_updatable(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/README.md b/src/InfinityFlow.DigitalOcean.Client/README.md new file mode 100644 index 0000000..cfe00e5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/README.md @@ -0,0 +1,17 @@ +ο»Ώ# DigitalOcean Client + +Regenerate the client with the following command: + +```bash +docker image rm -f mcr.microsoft.com/openapi/kiota:latest + +docker pull mcr.microsoft.com/openapi/kiota:latest + +# To Create +docker run -v ${PWD}:/app/output mcr.microsoft.com/openapi/kiota:latest generate --language csharp --class-name DigitalOceanClient --namespace-name InfinityFlow.DigitalOcean.Client -d https://api-engineering.nyc3.cdn.digitaloceanspaces.com/spec-ci/DigitalOcean-public.v2.yaml + +# To Update, uses the `kiota-lock.json`. + +docker run -v ${PWD}:/app/output mcr.microsoft.com/openapi/kiota:latest update +``` + diff --git a/src/InfinityFlow.DigitalOcean.Client/ServiceCollectionExtensions.cs b/src/InfinityFlow.DigitalOcean.Client/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..8be0594 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/ServiceCollectionExtensions.cs @@ -0,0 +1,74 @@ +ο»Ώusing Microsoft.Extensions.DependencyInjection; +using Microsoft.Kiota.Abstractions.Authentication; +using Microsoft.Kiota.Http.HttpClientLibrary; + +namespace InfinityFlow.DigitalOcean.Client; + +// TODO: Make this handle tokens dynamically +public class DigitalOceanClientFactory(HttpClient httpClient) +{ + public DigitalOceanClient GetClient(string token) => new(new HttpClientRequestAdapter(new BaseBearerTokenAuthenticationProvider(new StaticTokenProvider(token)), httpClient: httpClient)); +} + +public static class ServiceCollectionExtensions +{ + /// + /// Adds the Kiota handlers to the service collection. + /// + /// to add the services to + /// as per convention + /// The handlers are added to the http client by the call, which requires them to be pre-registered in DI + public static IServiceCollection AddDigitalOceanClient(this IServiceCollection services) + where TFactory : class + { + + services.AddHttpClient((sp, client) => + // Set the base address and accept header + // or other settings on the http client + client.BaseAddress = new Uri("https://api.digitalocean.com")).AttachKiotaHandlers(); // Attach the Kiota handlers to the http client, this is to enable all the Kiota features. + + services.AddScoped(sp => sp.GetRequiredService()); + return services; + } + + /// + /// Adds the Kiota handlers to the service collection. + /// + /// to add the services to + /// as per convention + /// The handlers are added to the http client by the call, which requires them to be pre-registered in DI + public static IServiceCollection AddKiotaHandlers(this IServiceCollection services) + { + // Dynamically load the Kiota handlers from the Client Factory + var kiotaHandlers = KiotaClientFactory.GetDefaultHandlerActivatableTypes(); + // And register them in the DI container + foreach (var handler in kiotaHandlers) + { + services.AddTransient(handler); + } + + return services; + } + + /// + /// Adds the Kiota handlers to the http client builder. + /// + /// + /// + /// + /// Requires the handlers to be registered in DI by . + /// The order in which the handlers are added is important, as it defines the order in which they will be executed. + /// + public static IHttpClientBuilder AttachKiotaHandlers(this IHttpClientBuilder builder) + { + // Dynamically load the Kiota handlers from the Client Factory + var kiotaHandlers = KiotaClientFactory.GetDefaultHandlerActivatableTypes(); + // And attach them to the http client builder + foreach (var handler in kiotaHandlers) + { + builder.AddHttpMessageHandler((sp) => (DelegatingHandler)sp.GetRequiredService(handler)); + } + + return builder; + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/StaticTokenProvider.cs b/src/InfinityFlow.DigitalOcean.Client/StaticTokenProvider.cs new file mode 100644 index 0000000..0ae3bd0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/StaticTokenProvider.cs @@ -0,0 +1,9 @@ +ο»Ώusing Microsoft.Kiota.Abstractions.Authentication; + +namespace InfinityFlow.DigitalOcean.Client; + +public class StaticTokenProvider(string Token) : IAccessTokenProvider +{ + AllowedHostsValidator IAccessTokenProvider.AllowedHostsValidator => new(); + public Task GetAuthorizationTokenAsync(Uri requestUri, Dictionary? additionalAuthenticationContext = null, CancellationToken cancellationToken = default) => Task.FromResult(Token); +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountGetResponse.cs new file mode 100644 index 0000000..43f3a92 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AccountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The account property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Account? Account { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Account Account { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public AccountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "account", n => { Account = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Account.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("account", Account); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountRequestBuilder.cs new file mode 100644 index 0000000..5a52dfe --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountRequestBuilder.cs @@ -0,0 +1,139 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Account.Keys; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account +{ + /// + /// Builds and executes requests for operations under \v2\account + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AccountRequestBuilder : BaseRequestBuilder + { + /// The keys property + public global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysRequestBuilder Keys + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AccountRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/account", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AccountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/account", rawUrl) + { + } + /// + /// To show information about the current user account, send a GET request to `/v2/account`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsAccountGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsAccountGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about the current user account, send a GET request to `/v2/account`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsAccountGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about the current user account, send a GET request to `/v2/account`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AccountRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountResponse.cs new file mode 100644 index 0000000..e23aab7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/AccountResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account +{ + [Obsolete("This class is obsolete. Use AccountGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AccountResponse : global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierGetResponse.cs new file mode 100644 index 0000000..65b039d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSsh_key_identifierGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ssh_key property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.SshKeys? SshKey { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.SshKeys SshKey { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithSsh_key_identifierGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ssh_key", n => { SshKey = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("ssh_key", SshKey); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierItemRequestBuilder.cs new file mode 100644 index 0000000..171cd59 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierItemRequestBuilder.cs @@ -0,0 +1,291 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item +{ + /// + /// Builds and executes requests for operations under \v2\account\keys\{ssh_key_identifier} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSsh_key_identifierItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSsh_key_identifierItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/account/keys/{ssh_key_identifier}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSsh_key_identifierItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/account/keys/{ssh_key_identifier}", rawUrl) + { + } + /// + /// To destroy a public SSH key that you have in your account, send a DELETE request to `/v2/account/keys/$KEY_ID` or `/v2/account/keys/$KEY_FINGERPRINT`.A 204 status will be returned, indicating that the action was successful and that the response body is empty. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about a key, send a GET request to `/v2/account/keys/$KEY_ID` or `/v2/account/keys/$KEY_FINGERPRINT`.The response will be a JSON object with the key `ssh_key` and value an ssh_key object which contains the standard ssh_key attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithSsh_key_identifierGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithSsh_key_identifierGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about a key, send a GET request to `/v2/account/keys/$KEY_ID` or `/v2/account/keys/$KEY_FINGERPRINT`.The response will be a JSON object with the key `ssh_key` and value an ssh_key object which contains the standard ssh_key attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithSsh_key_identifierGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of an SSH key, send a PUT request to either `/v2/account/keys/$SSH_KEY_ID` or `/v2/account/keys/$SSH_KEY_FINGERPRINT`. Set the `name` attribute to the new name you want to use. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithSsh_key_identifierPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithSsh_key_identifierPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of an SSH key, send a PUT request to either `/v2/account/keys/$SSH_KEY_ID` or `/v2/account/keys/$SSH_KEY_FINGERPRINT`. Set the `name` attribute to the new name you want to use. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithSsh_key_identifierPutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To destroy a public SSH key that you have in your account, send a DELETE request to `/v2/account/keys/$KEY_ID` or `/v2/account/keys/$KEY_FINGERPRINT`.A 204 status will be returned, indicating that the action was successful and that the response body is empty. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To get information about a key, send a GET request to `/v2/account/keys/$KEY_ID` or `/v2/account/keys/$KEY_FINGERPRINT`.The response will be a JSON object with the key `ssh_key` and value an ssh_key object which contains the standard ssh_key attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the name of an SSH key, send a PUT request to either `/v2/account/keys/$SSH_KEY_ID` or `/v2/account/keys/$SSH_KEY_FINGERPRINT`. Set the `name` attribute to the new name you want to use. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSsh_key_identifierItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSsh_key_identifierItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSsh_key_identifierItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierPutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierPutRequestBody.cs new file mode 100644 index 0000000..3dd9444 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierPutRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSsh_key_identifierPutRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithSsh_key_identifierPutRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierPutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierPutResponse.cs new file mode 100644 index 0000000..01635c1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierPutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSsh_key_identifierPutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ssh_key property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.SshKeys? SshKey { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.SshKeys SshKey { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithSsh_key_identifierPutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierPutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ssh_key", n => { SshKey = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("ssh_key", SshKey); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierResponse.cs new file mode 100644 index 0000000..9ebb4c6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/Item/WithSsh_key_identifierResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item +{ + [Obsolete("This class is obsolete. Use WithSsh_key_identifierGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSsh_key_identifierResponse : global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysGetResponse.cs new file mode 100644 index 0000000..ff95f20 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class KeysGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The ssh_keys property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SshKeys { get; set; } +#nullable restore +#else + public List SshKeys { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public KeysGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "ssh_keys", n => { SshKeys = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("ssh_keys", SshKeys); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysPostResponse.cs new file mode 100644 index 0000000..47333c0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class KeysPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ssh_key property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.SshKeys? SshKey { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.SshKeys SshKey { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public KeysPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ssh_key", n => { SshKey = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("ssh_key", SshKey); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysRequestBuilder.cs new file mode 100644 index 0000000..47cd302 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysRequestBuilder.cs @@ -0,0 +1,265 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys +{ + /// + /// Builds and executes requests for operations under \v2\account\keys + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KeysRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.account.keys.item collection + /// Either the ID or the fingerprint of an existing SSH key. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("ssh_key_identifier", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.account.keys.item collection + /// Either the ID or the fingerprint of an existing SSH key. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("ssh_key_identifier", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.Item.WithSsh_key_identifierItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public KeysRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/account/keys{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public KeysRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/account/keys{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the keys in your account, send a GET request to `/v2/account/keys`. The response will be a JSON object with a key set to `ssh_keys`. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsKeysGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsKeysGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the keys in your account, send a GET request to `/v2/account/keys`. The response will be a JSON object with a key set to `ssh_keys`. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsKeysGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add a new SSH public key to your DigitalOcean account, send a POST request to `/v2/account/keys`. Set the `name` attribute to the name you wish to use and the `public_key` attribute to the full public key you are adding. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsKeysPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsKeysPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add a new SSH public key to your DigitalOcean account, send a POST request to `/v2/account/keys`. Set the `name` attribute to the name you wish to use and the `public_key` attribute to the full public key you are adding. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsKeysPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the keys in your account, send a GET request to `/v2/account/keys`. The response will be a JSON object with a key set to `ssh_keys`. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To add a new SSH public key to your DigitalOcean account, send a POST request to `/v2/account/keys`. Set the `name` attribute to the name you wish to use and the `public_key` attribute to the full public key you are adding. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.SshKeys body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the keys in your account, send a GET request to `/v2/account/keys`. The response will be a JSON object with a key set to `ssh_keys`. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KeysRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KeysRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KeysRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysResponse.cs new file mode 100644 index 0000000..c998c68 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Account/Keys/KeysResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Account.Keys +{ + [Obsolete("This class is obsolete. Use KeysGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class KeysResponse : global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Account.Keys.KeysResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsGetResponse.cs new file mode 100644 index 0000000..345929b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ActionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..84646c4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,172 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Actions.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Actions +{ + /// + /// Builds and executes requests for operations under \v2\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/actions{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/actions{?page*,per_page*}", rawUrl) + { + } + /// + /// This will be the entire list of actions taken on your account, so it will be quite large. As with any large collection returned by the API, the results will be paginated with only 20 on each page by default. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsActionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsActionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This will be the entire list of actions taken on your account, so it will be quite large. As with any large collection returned by the API, the results will be paginated with only 20 on each page by default. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsActionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This will be the entire list of actions taken on your account, so it will be quite large. As with any large collection returned by the API, the results will be paginated with only 20 on each page by default. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// This will be the entire list of actions taken on your account, so it will be quite large. As with any large collection returned by the API, the results will be paginated with only 20 on each page by default. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsResponse.cs new file mode 100644 index 0000000..ca6b159 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Actions +{ + [Obsolete("This class is obsolete. Use ActionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_GetResponse.cs new file mode 100644 index 0000000..a0ccbad --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.ActionObject? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.ActionObject Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithAction_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_ItemRequestBuilder.cs new file mode 100644 index 0000000..c88f496 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_ItemRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Actions.Item +{ + /// + /// Builds and executes requests for operations under \v2\actions\{action_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/actions/{action_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/actions/{action_id}", rawUrl) + { + } + /// + /// To retrieve a specific action object, send a GET request to `/v2/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithAction_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithAction_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a specific action object, send a GET request to `/v2/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithAction_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a specific action object, send a GET request to `/v2/actions/$ACTION_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_Response.cs new file mode 100644 index 0000000..07c3a9c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Actions/Item/WithAction_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Actions.Item +{ + [Obsolete("This class is obsolete. Use WithAction_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_Response : global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Actions.Item.WithAction_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/AppsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/AppsRequestBuilder.cs new file mode 100644 index 0000000..61b128f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/AppsRequestBuilder.cs @@ -0,0 +1,217 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Propose; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Regions; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps +{ + /// + /// Builds and executes requests for operations under \v2\apps + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AppsRequestBuilder : BaseRequestBuilder + { + /// The metrics property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.MetricsRequestBuilder Metrics + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter); + } + /// The propose property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Propose.ProposeRequestBuilder Propose + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Propose.ProposeRequestBuilder(PathParameters, RequestAdapter); + } + /// The regions property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Regions.RegionsRequestBuilder Regions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Regions.RegionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The tiers property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.TiersRequestBuilder Tiers + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.TiersRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.apps.item collection + /// The ID of the app + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.App_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("app_%2Did", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.App_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AppsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps{?page*,per_page*,with_projects*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AppsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps{?page*,per_page*,with_projects*}", rawUrl) + { + } + /// + /// List all apps on your account. Information about the current active deployment as well as any in progress ones will also be included for each app. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Create a new app by submitting an app specification. For documentation on app specifications (`AppSpec` objects), please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/). + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_app_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_app_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.App_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// List all apps on your account. Information about the current active deployment as well as any in progress ones will also be included for each app. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create a new app by submitting an app specification. For documentation on app specifications (`AppSpec` objects), please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/). + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_app_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_app_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.AppsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.AppsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// List all apps on your account. Information about the current active deployment as well as any in progress ones will also be included for each app. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AppsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// Whether the project_id of listed apps should be fetched and included. + [QueryParameter("with_projects")] + public bool? WithProjects { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AppsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AppsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/AlertsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/AlertsRequestBuilder.cs new file mode 100644 index 0000000..c25b2d8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/AlertsRequestBuilder.cs @@ -0,0 +1,118 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\alerts + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.apps.item.alerts.item collection + /// The alert ID + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.WithAlert_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("alert_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.WithAlert_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AlertsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/alerts", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AlertsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/alerts", rawUrl) + { + } + /// + /// List alerts associated to the app and any components. This includes configuration information about the alerts including emails, slack webhooks, and triggering events or conditions. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_alerts_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// List alerts associated to the app and any components. This includes configuration information about the alerts including emails, slack webhooks, and triggering events or conditions. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.AlertsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.AlertsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/Item/Destinations/DestinationsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/Item/Destinations/DestinationsRequestBuilder.cs new file mode 100644 index 0000000..b1f3883 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/Item/Destinations/DestinationsRequestBuilder.cs @@ -0,0 +1,110 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.Destinations +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\alerts\{alert_id}\destinations + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DestinationsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DestinationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/alerts/{alert_id}/destinations", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DestinationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/alerts/{alert_id}/destinations", rawUrl) + { + } + /// + /// Updates the emails and slack webhook destinations for app alerts. Emails must be associated to a user with access to the app. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_assign_app_alert_destinations_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_assign_app_alert_destinations_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_alert_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates the emails and slack webhook destinations for app alerts. Emails must be associated to a user with access to the app. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_assign_app_alert_destinations_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_assign_app_alert_destinations_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.Destinations.DestinationsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.Destinations.DestinationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DestinationsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/Item/WithAlert_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/Item/WithAlert_ItemRequestBuilder.cs new file mode 100644 index 0000000..4c81ccd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Alerts/Item/WithAlert_ItemRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.Destinations; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\alerts\{alert_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_ItemRequestBuilder : BaseRequestBuilder + { + /// The destinations property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.Destinations.DestinationsRequestBuilder Destinations + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.Item.Destinations.DestinationsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAlert_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/alerts/{alert_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAlert_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/alerts/{alert_id}", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/App_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/App_ItemRequestBuilder.cs new file mode 100644 index 0000000..6613987 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/App_ItemRequestBuilder.cs @@ -0,0 +1,279 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Restart; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ItemRequestBuilder : BaseRequestBuilder + { + /// The alerts property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.AlertsRequestBuilder Alerts + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Alerts.AlertsRequestBuilder(PathParameters, RequestAdapter); + } + /// The components property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.ComponentsRequestBuilder Components + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.ComponentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The deployments property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.DeploymentsRequestBuilder Deployments + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.DeploymentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The metrics property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.MetricsRequestBuilder Metrics + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter); + } + /// The restart property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Restart.RestartRequestBuilder Restart + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Restart.RestartRequestBuilder(PathParameters, RequestAdapter); + } + /// The rollback property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.RollbackRequestBuilder Rollback + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.RollbackRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public App_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}{?name*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public App_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}{?name*}", rawUrl) + { + } + /// + /// Delete an existing app. Once deleted, all active deployments will be permanently shut down and the app deleted. If needed, be sure to back up your app specification so that you may re-create it at a later time. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_delete_app_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieve details about an existing app by either its ID or name. To retrieve an app by its name, do not include an ID in the request path. Information about the current active deployment as well as any in progress ones will also be included in the response. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.App_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Update an existing app by submitting a new app specification. For documentation on app specifications (`AppSpec` objects), please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/). + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_update_app_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_update_app_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.App_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete an existing app. Once deleted, all active deployments will be permanently shut down and the app deleted. If needed, be sure to back up your app specification so that you may re-create it at a later time. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve details about an existing app by either its ID or name. To retrieve an app by its name, do not include an ID in the request path. Information about the current active deployment as well as any in progress ones will also be included in the response. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update an existing app by submitting a new app specification. For documentation on app specifications (`AppSpec` objects), please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/). + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_update_app_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_update_app_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.App_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.App_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Retrieve details about an existing app by either its ID or name. To retrieve an app by its name, do not include an ID in the request path. Information about the current active deployment as well as any in progress ones will also be included in the response. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ItemRequestBuilderGetQueryParameters + { + /// The name of the app to retrieve. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class App_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/ComponentsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/ComponentsRequestBuilder.cs new file mode 100644 index 0000000..3f282d6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/ComponentsRequestBuilder.cs @@ -0,0 +1,48 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\components + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ComponentsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.apps.item.components.item collection + /// An optional component name. If set, logs will be limited to this component only. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.WithComponent_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("component_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.WithComponent_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ComponentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/components", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ComponentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/components", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/Item/Exec/ExecRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/Item/Exec/ExecRequestBuilder.cs new file mode 100644 index 0000000..e40fe37 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/Item/Exec/ExecRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.Exec +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\components\{component_name}\exec + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ExecRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ExecRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/components/{component_name}/exec", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ExecRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/components/{component_name}/exec", rawUrl) + { + } + /// + /// Returns a websocket URL that allows sending/receiving console input and output to a component of the active deployment if one exists. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_exec_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a websocket URL that allows sending/receiving console input and output to a component of the active deployment if one exists. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.Exec.ExecRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.Exec.ExecRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ExecRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/Item/WithComponent_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/Item/WithComponent_nameItemRequestBuilder.cs new file mode 100644 index 0000000..c839933 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Components/Item/WithComponent_nameItemRequestBuilder.cs @@ -0,0 +1,42 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.Exec; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\components\{component_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithComponent_nameItemRequestBuilder : BaseRequestBuilder + { + /// The exec property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.Exec.ExecRequestBuilder Exec + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Components.Item.Exec.ExecRequestBuilder(PathParameters, RequestAdapter); + } + + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithComponent_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/components/{component_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithComponent_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/components/{component_name}", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/DeploymentsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/DeploymentsRequestBuilder.cs new file mode 100644 index 0000000..da7d1af --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/DeploymentsRequestBuilder.cs @@ -0,0 +1,194 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\deployments + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DeploymentsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.apps.item.deployments.item collection + /// The deployment ID + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.WithDeployment_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("deployment_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.WithDeployment_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DeploymentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DeploymentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments{?page*,per_page*}", rawUrl) + { + } + /// + /// List all deployments of an app. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployments_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_deployment_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_deployment_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// List all deployments of an app. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Creating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_deployment_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_create_deployment_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.DeploymentsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.DeploymentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// List all deployments of an app. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DeploymentsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DeploymentsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DeploymentsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Cancel/CancelRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Cancel/CancelRequestBuilder.cs new file mode 100644 index 0000000..9e2c74c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Cancel/CancelRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Cancel +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\deployments\{deployment_id}\cancel + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CancelRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/cancel", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/cancel", rawUrl) + { + } + /// + /// Immediately cancel an in-progress deployment. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Immediately cancel an in-progress deployment. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Cancel.CancelRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Cancel.CancelRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CancelRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/ComponentsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/ComponentsRequestBuilder.cs new file mode 100644 index 0000000..551f630 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/ComponentsRequestBuilder.cs @@ -0,0 +1,48 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\deployments\{deployment_id}\components + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ComponentsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.apps.item.deployments.item.components.item collection + /// An optional component name. If set, logs will be limited to this component only. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.WithComponent_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("component_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.WithComponent_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ComponentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/components", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ComponentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/components", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/Item/Exec/ExecRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/Item/Exec/ExecRequestBuilder.cs new file mode 100644 index 0000000..2c38fb4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/Item/Exec/ExecRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.Exec +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\deployments\{deployment_id}\components\{component_name}\exec + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ExecRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ExecRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/components/{component_name}/exec", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ExecRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/components/{component_name}/exec", rawUrl) + { + } + /// + /// Returns a websocket URL that allows sending/receiving console input and output to a component of the specified deployment if one exists. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_exec_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a websocket URL that allows sending/receiving console input and output to a component of the specified deployment if one exists. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.Exec.ExecRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.Exec.ExecRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ExecRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/Item/WithComponent_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/Item/WithComponent_nameItemRequestBuilder.cs new file mode 100644 index 0000000..80c1a92 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/Components/Item/WithComponent_nameItemRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.Exec; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\deployments\{deployment_id}\components\{component_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithComponent_nameItemRequestBuilder : BaseRequestBuilder + { + /// The exec property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.Exec.ExecRequestBuilder Exec + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.Item.Exec.ExecRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithComponent_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/components/{component_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithComponent_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}/components/{component_name}", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/WithDeployment_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/WithDeployment_ItemRequestBuilder.cs new file mode 100644 index 0000000..b5e6a8a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Deployments/Item/WithDeployment_ItemRequestBuilder.cs @@ -0,0 +1,117 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Cancel; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\deployments\{deployment_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDeployment_ItemRequestBuilder : BaseRequestBuilder + { + /// The cancel property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Cancel.CancelRequestBuilder Cancel + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Cancel.CancelRequestBuilder(PathParameters, RequestAdapter); + } + /// The components property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.ComponentsRequestBuilder Components + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.Components.ComponentsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDeployment_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDeployment_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/deployments/{deployment_id}", rawUrl) + { + } + /// + /// Retrieve information about an app deployment. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieve information about an app deployment. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.WithDeployment_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Deployments.Item.WithDeployment_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDeployment_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Metrics/Bandwidth_daily/Bandwidth_dailyRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Metrics/Bandwidth_daily/Bandwidth_dailyRequestBuilder.cs new file mode 100644 index 0000000..cc24600 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Metrics/Bandwidth_daily/Bandwidth_dailyRequestBuilder.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.Bandwidth_daily +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\metrics\bandwidth_daily + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Bandwidth_dailyRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Bandwidth_dailyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/metrics/bandwidth_daily{?date*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Bandwidth_dailyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/metrics/bandwidth_daily{?date*}", rawUrl) + { + } + /// + /// Retrieve daily bandwidth usage metrics for a single app. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieve daily bandwidth usage metrics for a single app. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieve daily bandwidth usage metrics for a single app. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Bandwidth_dailyRequestBuilderGetQueryParameters + { + /// Optional day to query. Only the date component of the timestamp will be considered. Default: yesterday. + [QueryParameter("date")] + public DateTimeOffset? Date { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Bandwidth_dailyRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Metrics/MetricsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Metrics/MetricsRequestBuilder.cs new file mode 100644 index 0000000..e7dde8a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Metrics/MetricsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.Bandwidth_daily; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\metrics + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MetricsRequestBuilder : BaseRequestBuilder + { + /// The bandwidth_daily property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder Bandwidth_daily + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/metrics", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/metrics", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Restart/RestartRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Restart/RestartRequestBuilder.cs new file mode 100644 index 0000000..fa6aadb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Restart/RestartRequestBuilder.cs @@ -0,0 +1,110 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Restart +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\restart + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RestartRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RestartRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/restart", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RestartRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/restart", rawUrl) + { + } + /// + /// Perform a rolling restart of all or specific components in an app. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_restart_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_restart_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Perform a rolling restart of all or specific components in an app. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_restart_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_restart_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Restart.RestartRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Restart.RestartRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RestartRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Commit/CommitRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Commit/CommitRequestBuilder.cs new file mode 100644 index 0000000..3165aef --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Commit/CommitRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Commit +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\rollback\commit + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CommitRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CommitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback/commit", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CommitRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback/commit", rawUrl) + { + } + /// + /// Commit an app rollback. This action permanently applies the rollback and unpins the app to resume new deployments. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Commit an app rollback. This action permanently applies the rollback and unpins the app to resume new deployments. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Commit.CommitRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Commit.CommitRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CommitRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Revert/RevertRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Revert/RevertRequestBuilder.cs new file mode 100644 index 0000000..615af7e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Revert/RevertRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Revert +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\rollback\revert + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RevertRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RevertRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback/revert", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RevertRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback/revert", rawUrl) + { + } + /// + /// Revert an app rollback. This action reverts the active rollback by creating a new deployment from thelatest app spec prior to the rollback and unpins the app to resume new deployments. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Revert an app rollback. This action reverts the active rollback by creating a new deployment from thelatest app spec prior to the rollback and unpins the app to resume new deployments. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Revert.RevertRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Revert.RevertRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RevertRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/RollbackRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/RollbackRequestBuilder.cs new file mode 100644 index 0000000..945ae2d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/RollbackRequestBuilder.cs @@ -0,0 +1,128 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Commit; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Revert; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\rollback + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RollbackRequestBuilder : BaseRequestBuilder + { + /// The commit property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Commit.CommitRequestBuilder Commit + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Commit.CommitRequestBuilder(PathParameters, RequestAdapter); + } + /// The revert property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Revert.RevertRequestBuilder Revert + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Revert.RevertRequestBuilder(PathParameters, RequestAdapter); + } + /// The validate property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidateRequestBuilder Validate + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidateRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RollbackRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RollbackRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback", rawUrl) + { + } + /// + /// Rollback an app to a previous deployment. A new deployment will be created to perform the rollback.The app will be pinned to the rollback deployment preventing any new deployments from being created,either manually or through Auto Deploy on Push webhooks. To resume deployments, the rollback must beeither committed or reverted.It is recommended to use the Validate App Rollback endpoint to double check if the rollback isvalid and if there are any warnings. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_deployment_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Rollback an app to a previous deployment. A new deployment will be created to perform the rollback.The app will be pinned to the rollback deployment preventing any new deployments from being created,either manually or through Auto Deploy on Push webhooks. To resume deployments, the rollback must beeither committed or reverted.It is recommended to use the Validate App Rollback endpoint to double check if the rollback isvalid and if there are any warnings. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.RollbackRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.RollbackRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RollbackRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidatePostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidatePostResponse.cs new file mode 100644 index 0000000..a623fa8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidatePostResponse.cs @@ -0,0 +1,80 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ValidatePostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The error property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.App_rollback_validation_condition? Error { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.App_rollback_validation_condition Error { get; set; } +#endif + /// Indicates whether the app can be rolled back to the specified deployment. + public bool? Valid { get; set; } + /// Contains a list of warnings that may cause the rollback to run under unideal circumstances. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Warnings { get; set; } +#nullable restore +#else + public List Warnings { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ValidatePostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidatePostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidatePostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "error", n => { Error = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.App_rollback_validation_condition.CreateFromDiscriminatorValue); } }, + { "valid", n => { Valid = n.GetBoolValue(); } }, + { "warnings", n => { Warnings = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.App_rollback_validation_condition.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("error", Error); + writer.WriteBoolValue("valid", Valid); + writer.WriteCollectionOfObjectValues("warnings", Warnings); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidateRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidateRequestBuilder.cs new file mode 100644 index 0000000..f72efa1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidateRequestBuilder.cs @@ -0,0 +1,144 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate +{ + /// + /// Builds and executes requests for operations under \v2\apps\{app_-id}\rollback\validate + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ValidateRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ValidateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback/validate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ValidateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/{app_%2Did}/rollback/validate", rawUrl) + { + } + /// + /// Check whether an app can be rolled back to a specific deployment. This endpoint can also be usedto check if there are any warnings or validation conditions that will cause the rollback to proceedunder unideal circumstances. For example, if a component must be rebuilt as part of the rollbackcausing it to take longer than usual. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsValidatePostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsValidatePostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidatePostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Check whether an app can be rolled back to a specific deployment. This endpoint can also be usedto check if there are any warnings or validation conditions that will cause the rollback to proceedunder unideal circumstances. For example, if a component must be rebuilt as part of the rollbackcausing it to take longer than usual. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsValidatePostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidateResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Check whether an app can be rolled back to a specific deployment. This endpoint can also be usedto check if there are any warnings or validation conditions that will cause the rollback to proceedunder unideal circumstances. For example, if a component must be rebuilt as part of the rollbackcausing it to take longer than usual. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Apps_rollback_app_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidateRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidateRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ValidateRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidateResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidateResponse.cs new file mode 100644 index 0000000..5fde46c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Item/Rollback/Validate/ValidateResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate +{ + [Obsolete("This class is obsolete. Use ValidatePostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ValidateResponse : global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidatePostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidateResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Item.Rollback.Validate.ValidateResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Metrics/Bandwidth_daily/Bandwidth_dailyRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Metrics/Bandwidth_daily/Bandwidth_dailyRequestBuilder.cs new file mode 100644 index 0000000..dc5a068 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Metrics/Bandwidth_daily/Bandwidth_dailyRequestBuilder.cs @@ -0,0 +1,110 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.Bandwidth_daily +{ + /// + /// Builds and executes requests for operations under \v2\apps\metrics\bandwidth_daily + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Bandwidth_dailyRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Bandwidth_dailyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/metrics/bandwidth_daily", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Bandwidth_dailyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/metrics/bandwidth_daily", rawUrl) + { + } + /// + /// Retrieve daily bandwidth usage metrics for multiple apps. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieve daily bandwidth usage metrics for multiple apps. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.App_metrics_bandwidth_usage_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Bandwidth_dailyRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Metrics/MetricsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Metrics/MetricsRequestBuilder.cs new file mode 100644 index 0000000..215ee32 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Metrics/MetricsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.Bandwidth_daily; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics +{ + /// + /// Builds and executes requests for operations under \v2\apps\metrics + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MetricsRequestBuilder : BaseRequestBuilder + { + /// The bandwidth_daily property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder Bandwidth_daily + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Metrics.Bandwidth_daily.Bandwidth_dailyRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/metrics", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/metrics", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Propose/ProposeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Propose/ProposeRequestBuilder.cs new file mode 100644 index 0000000..4f2ac73 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Propose/ProposeRequestBuilder.cs @@ -0,0 +1,108 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Propose +{ + /// + /// Builds and executes requests for operations under \v2\apps\propose + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ProposeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProposeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/propose", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProposeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/propose", rawUrl) + { + } + /// + /// To propose and validate a spec for a new or existing app, send a POST request to the `/v2/apps/propose` endpoint. The request returns some information about the proposed app, including app cost and upgrade cost. If an existing app ID is specified, the app spec is treated as a proposed update to the existing app. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.App_propose body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.App_propose body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.App_propose_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To propose and validate a spec for a new or existing app, send a POST request to the `/v2/apps/propose` endpoint. The request returns some information about the proposed app, including app cost and upgrade cost. If an existing app ID is specified, the app spec is treated as a proposed update to the existing app. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.App_propose body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.App_propose body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Propose.ProposeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Propose.ProposeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ProposeRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Regions/RegionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Regions/RegionsRequestBuilder.cs new file mode 100644 index 0000000..95cba22 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Regions/RegionsRequestBuilder.cs @@ -0,0 +1,103 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Regions +{ + /// + /// Builds and executes requests for operations under \v2\apps\regions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RegionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/regions", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RegionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/regions", rawUrl) + { + } + /// + /// List all regions supported by App Platform. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_regions_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// List all regions supported by App Platform. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Regions.RegionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Regions.RegionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/Instance_sizes/Instance_sizesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/Instance_sizes/Instance_sizesRequestBuilder.cs new file mode 100644 index 0000000..1a09e5a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/Instance_sizes/Instance_sizesRequestBuilder.cs @@ -0,0 +1,116 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes +{ + /// + /// Builds and executes requests for operations under \v2\apps\tiers\instance_sizes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Instance_sizesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.apps.tiers.instance_sizes.item collection + /// The slug of the instance size + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Item.WithSlugItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("slug", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Item.WithSlugItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Instance_sizesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/tiers/instance_sizes", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Instance_sizesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/tiers/instance_sizes", rawUrl) + { + } + /// + /// List all instance sizes for `service`, `worker`, and `job` components. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_list_instance_sizes_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// List all instance sizes for `service`, `worker`, and `job` components. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Instance_sizesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Instance_sizesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Instance_sizesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/Instance_sizes/Item/WithSlugItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/Instance_sizes/Item/WithSlugItemRequestBuilder.cs new file mode 100644 index 0000000..3a76785 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/Instance_sizes/Item/WithSlugItemRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Item +{ + /// + /// Builds and executes requests for operations under \v2\apps\tiers\instance_sizes\{slug} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSlugItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSlugItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/tiers/instance_sizes/{slug}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSlugItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/tiers/instance_sizes/{slug}", rawUrl) + { + } + /// + /// Retrieve information about a specific instance size for `service`, `worker`, and `job` components. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Apps_get_instance_size_response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieve information about a specific instance size for `service`, `worker`, and `job` components. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Item.WithSlugItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Item.WithSlugItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSlugItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/TiersRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/TiersRequestBuilder.cs new file mode 100644 index 0000000..e47004e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Apps/Tiers/TiersRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers +{ + /// + /// Builds and executes requests for operations under \v2\apps\tiers + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TiersRequestBuilder : BaseRequestBuilder + { + /// The instance_sizes property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Instance_sizesRequestBuilder Instance_sizes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.Tiers.Instance_sizes.Instance_sizesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TiersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/tiers", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TiersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/apps/tiers", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/CdnRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/CdnRequestBuilder.cs new file mode 100644 index 0000000..22e7a9d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/CdnRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn +{ + /// + /// Builds and executes requests for operations under \v2\cdn + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CdnRequestBuilder : BaseRequestBuilder + { + /// The endpoints property + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsRequestBuilder Endpoints + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CdnRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CdnRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsGetResponse.cs new file mode 100644 index 0000000..ac94cb4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class EndpointsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endpoints property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Endpoints { get; set; } +#nullable restore +#else + public List Endpoints { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EndpointsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endpoints", n => { Endpoints = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("endpoints", Endpoints); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsPostResponse.cs new file mode 100644 index 0000000..6abdded --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class EndpointsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endpoint property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint? Endpoint { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint Endpoint { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EndpointsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endpoint", n => { Endpoint = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endpoint", Endpoint); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsRequestBuilder.cs new file mode 100644 index 0000000..fdb6e46 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsRequestBuilder.cs @@ -0,0 +1,265 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints +{ + /// + /// Builds and executes requests for operations under \v2\cdn\endpoints + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class EndpointsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.cdn.endpoints.item collection + /// A unique identifier for a CDN endpoint. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("cdn_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.cdn.endpoints.item collection + /// A unique identifier for a CDN endpoint. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("cdn_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EndpointsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn/endpoints{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EndpointsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn/endpoints{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the CDN endpoints available on your account, send a GET request to `/v2/cdn/endpoints`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsEndpointsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsEndpointsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the CDN endpoints available on your account, send a GET request to `/v2/cdn/endpoints`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsEndpointsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new CDN endpoint, send a POST request to `/v2/cdn/endpoints`. Theorigin attribute must be set to the fully qualified domain name (FQDN) of aDigitalOcean Space. Optionally, the TTL may be configured by setting the `ttl`attribute.A custom subdomain may be configured by specifying the `custom_domain` and`certificate_id` attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsEndpointsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsEndpointsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new CDN endpoint, send a POST request to `/v2/cdn/endpoints`. Theorigin attribute must be set to the fully qualified domain name (FQDN) of aDigitalOcean Space. Optionally, the TTL may be configured by setting the `ttl`attribute.A custom subdomain may be configured by specifying the `custom_domain` and`certificate_id` attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsEndpointsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the CDN endpoints available on your account, send a GET request to `/v2/cdn/endpoints`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new CDN endpoint, send a POST request to `/v2/cdn/endpoints`. Theorigin attribute must be set to the fully qualified domain name (FQDN) of aDigitalOcean Space. Optionally, the TTL may be configured by setting the `ttl`attribute.A custom subdomain may be configured by specifying the `custom_domain` and`certificate_id` attributes. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the CDN endpoints available on your account, send a GET request to `/v2/cdn/endpoints`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class EndpointsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class EndpointsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class EndpointsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsResponse.cs new file mode 100644 index 0000000..9e13841 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/EndpointsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints +{ + [Obsolete("This class is obsolete. Use EndpointsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class EndpointsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.EndpointsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/Cache/CacheRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/Cache/CacheRequestBuilder.cs new file mode 100644 index 0000000..6f36dfa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/Cache/CacheRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.Cache +{ + /// + /// Builds and executes requests for operations under \v2\cdn\endpoints\{cdn_id}\cache + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CacheRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CacheRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn/endpoints/{cdn_id}/cache", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CacheRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn/endpoints/{cdn_id}/cache", rawUrl) + { + } + /// + /// To purge cached content from a CDN endpoint, send a DELETE request to`/v2/cdn/endpoints/$ENDPOINT_ID/cache`. The body of the request should includea `files` attribute containing a list of cached file paths to be purged. Apath may be for a single file or may contain a wildcard (`*`) to recursivelypurge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. CDN endpoints have a rate limit of 5 requests per 10 seconds. Purging files using a wildcard path counts as a single request against the API's rate limit. Two identical purge requests cannot be sent at the same time. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Purge_cache body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Purge_cache body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To purge cached content from a CDN endpoint, send a DELETE request to`/v2/cdn/endpoints/$ENDPOINT_ID/cache`. The body of the request should includea `files` attribute containing a list of cached file paths to be purged. Apath may be for a single file or may contain a wildcard (`*`) to recursivelypurge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. CDN endpoints have a rate limit of 5 requests per 10 seconds. Purging files using a wildcard path counts as a single request against the API's rate limit. Two identical purge requests cannot be sent at the same time. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Purge_cache body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Purge_cache body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.Cache.CacheRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.Cache.CacheRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CacheRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_GetResponse.cs new file mode 100644 index 0000000..412e365 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCdn_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endpoint property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint? Endpoint { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint Endpoint { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithCdn_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endpoint", n => { Endpoint = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endpoint", Endpoint); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_ItemRequestBuilder.cs new file mode 100644 index 0000000..d032e1f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_ItemRequestBuilder.cs @@ -0,0 +1,297 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.Cache; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item +{ + /// + /// Builds and executes requests for operations under \v2\cdn\endpoints\{cdn_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCdn_ItemRequestBuilder : BaseRequestBuilder + { + /// The cache property + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.Cache.CacheRequestBuilder Cache + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.Cache.CacheRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCdn_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn/endpoints/{cdn_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCdn_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/cdn/endpoints/{cdn_id}", rawUrl) + { + } + /// + /// To delete a specific CDN endpoint, send a DELETE request to`/v2/cdn/endpoints/$ENDPOINT_ID`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing CDN endpoint, send a GET request to `/v2/cdn/endpoints/$ENDPOINT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithCdn_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithCdn_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing CDN endpoint, send a GET request to `/v2/cdn/endpoints/$ENDPOINT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithCdn_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the TTL, certificate ID, or the FQDN of the custom subdomain foran existing CDN endpoint, send a PUT request to`/v2/cdn/endpoints/$ENDPOINT_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithCdn_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithCdn_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the TTL, certificate ID, or the FQDN of the custom subdomain foran existing CDN endpoint, send a PUT request to`/v2/cdn/endpoints/$ENDPOINT_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithCdn_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a specific CDN endpoint, send a DELETE request to`/v2/cdn/endpoints/$ENDPOINT_ID`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing CDN endpoint, send a GET request to `/v2/cdn/endpoints/$ENDPOINT_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the TTL, certificate ID, or the FQDN of the custom subdomain foran existing CDN endpoint, send a PUT request to`/v2/cdn/endpoints/$ENDPOINT_ID`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Update_endpoint body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCdn_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCdn_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCdn_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_PutResponse.cs new file mode 100644 index 0000000..a56ad1f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCdn_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endpoint property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint? Endpoint { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint Endpoint { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithCdn_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endpoint", n => { Endpoint = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Cdn_endpoint.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endpoint", Endpoint); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_Response.cs new file mode 100644 index 0000000..9c1fb82 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Cdn/Endpoints/Item/WithCdn_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item +{ + [Obsolete("This class is obsolete. Use WithCdn_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCdn_Response : global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.Endpoints.Item.WithCdn_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesGetResponse.cs new file mode 100644 index 0000000..c44284b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Certificates +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CertificatesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The certificates property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Certificates { get; set; } +#nullable restore +#else + public List Certificates { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CertificatesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificates", n => { Certificates = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Certificate.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("certificates", Certificates); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesPostResponse.cs new file mode 100644 index 0000000..b3059b3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Certificates +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CertificatesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The certificate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate? Certificate { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate Certificate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CertificatesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate", n => { Certificate = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Certificate.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("certificate", Certificate); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesRequestBuilder.cs new file mode 100644 index 0000000..030df09 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesRequestBuilder.cs @@ -0,0 +1,350 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Certificates.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Certificates +{ + /// + /// Builds and executes requests for operations under \v2\certificates + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CertificatesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.certificates.item collection + /// A unique identifier for a certificate. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("certificate_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.certificates.item collection + /// A unique identifier for a certificate. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("certificate_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CertificatesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/certificates{?name*,page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CertificatesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/certificates{?name*,page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the certificates available on your account, send a GET request to `/v2/certificates`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsCertificatesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsCertificatesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the certificates available on your account, send a GET request to `/v2/certificates`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsCertificatesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To upload new SSL certificate which you have previously generated, send a POSTrequest to `/v2/certificates`.When uploading a user-generated certificate, the `private_key`,`leaf_certificate`, and optionally the `certificate_chain` attributes shouldbe provided. The type must be set to `custom`.When using Let's Encrypt to create a certificate, the `dns_names` attributemust be provided, and the type must be set to `lets_encrypt`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsCertificatesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsCertificatesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To upload new SSL certificate which you have previously generated, send a POSTrequest to `/v2/certificates`.When uploading a user-generated certificate, the `private_key`,`leaf_certificate`, and optionally the `certificate_chain` attributes shouldbe provided. The type must be set to `custom`.When using Let's Encrypt to create a certificate, the `dns_names` attributemust be provided, and the type must be set to `lets_encrypt`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsCertificatesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the certificates available on your account, send a GET request to `/v2/certificates`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To upload new SSL certificate which you have previously generated, send a POSTrequest to `/v2/certificates`.When uploading a user-generated certificate, the `private_key`,`leaf_certificate`, and optionally the `certificate_chain` attributes shouldbe provided. The type must be set to `custom`.When using Let's Encrypt to create a certificate, the `dns_names` attributemust be provided, and the type must be set to `lets_encrypt`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CertificatesPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_custom? CertificateRequestCustom { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_custom CertificateRequestCustom { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_lets_encrypt? CertificateRequestLetsEncrypt { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_lets_encrypt CertificateRequestLetsEncrypt { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder.CertificatesPostRequestBody(); + if("certificate_request_custom".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.CertificateRequestCustom = new global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_custom(); + } + else if("certificate_request_lets_encrypt".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.CertificateRequestLetsEncrypt = new global::InfinityFlow.DigitalOcean.Client.Models.Certificate_request_lets_encrypt(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(CertificateRequestCustom != null) + { + return CertificateRequestCustom.GetFieldDeserializers(); + } + else if(CertificateRequestLetsEncrypt != null) + { + return CertificateRequestLetsEncrypt.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(CertificateRequestCustom != null) + { + writer.WriteObjectValue(null, CertificateRequestCustom); + } + else if(CertificateRequestLetsEncrypt != null) + { + writer.WriteObjectValue(null, CertificateRequestLetsEncrypt); + } + } + } + /// + /// To list all of the certificates available on your account, send a GET request to `/v2/certificates`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CertificatesRequestBuilderGetQueryParameters + { + /// Name of expected certificate +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CertificatesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CertificatesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesResponse.cs new file mode 100644 index 0000000..f56e409 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/CertificatesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Certificates +{ + [Obsolete("This class is obsolete. Use CertificatesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CertificatesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_GetResponse.cs new file mode 100644 index 0000000..90b29bb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Certificates.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCertificate_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The certificate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate? Certificate { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Certificate Certificate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithCertificate_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "certificate", n => { Certificate = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Certificate.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("certificate", Certificate); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_ItemRequestBuilder.cs new file mode 100644 index 0000000..541685d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_ItemRequestBuilder.cs @@ -0,0 +1,194 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Certificates.Item +{ + /// + /// Builds and executes requests for operations under \v2\certificates\{certificate_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCertificate_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCertificate_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/certificates/{certificate_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCertificate_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/certificates/{certificate_id}", rawUrl) + { + } + /// + /// To delete a specific certificate, send a DELETE request to`/v2/certificates/$CERTIFICATE_ID`. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing certificate, send a GET request to `/v2/certificates/$CERTIFICATE_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithCertificate_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithCertificate_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing certificate, send a GET request to `/v2/certificates/$CERTIFICATE_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithCertificate_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a specific certificate, send a DELETE request to`/v2/certificates/$CERTIFICATE_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing certificate, send a GET request to `/v2/certificates/$CERTIFICATE_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCertificate_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCertificate_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_Response.cs new file mode 100644 index 0000000..967acfc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Certificates/Item/WithCertificate_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Certificates.Item +{ + [Obsolete("This class is obsolete. Use WithCertificate_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCertificate_Response : global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.Item.WithCertificate_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/CustomersRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/CustomersRequestBuilder.cs new file mode 100644 index 0000000..3dd471a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/CustomersRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Customers.My; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers +{ + /// + /// Builds and executes requests for operations under \v2\customers + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CustomersRequestBuilder : BaseRequestBuilder + { + /// The my property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.MyRequestBuilder My + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.MyRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CustomersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CustomersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Balance/BalanceRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Balance/BalanceRequestBuilder.cs new file mode 100644 index 0000000..3aca10b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Balance/BalanceRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Balance +{ + /// + /// Builds and executes requests for operations under \v2\customers\my\balance + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class BalanceRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public BalanceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/balance", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public BalanceRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/balance", rawUrl) + { + } + /// + /// To retrieve the balances on a customer's account, send a GET request to `/v2/customers/my/balance`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Balance.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the balances on a customer's account, send a GET request to `/v2/customers/my/balance`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Balance.BalanceRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Balance.BalanceRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class BalanceRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyGetResponse.cs new file mode 100644 index 0000000..0d3c163 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Billing_historyGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The billing_history property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BillingHistory { get; set; } +#nullable restore +#else + public List BillingHistory { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// Information about the response itself. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Billing_historyGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "billing_history", n => { BillingHistory = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Billing_history.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("billing_history", BillingHistory); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyRequestBuilder.cs new file mode 100644 index 0000000..50c1d13 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history +{ + /// + /// Builds and executes requests for operations under \v2\customers\my\billing_history + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Billing_historyRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Billing_historyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/billing_history", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Billing_historyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/billing_history", rawUrl) + { + } + /// + /// To retrieve a list of all billing history entries, send a GET request to `/v2/customers/my/billing_history`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsBilling_historyGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsBilling_historyGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all billing history entries, send a GET request to `/v2/customers/my/billing_history`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsBilling_historyGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all billing history entries, send a GET request to `/v2/customers/my/billing_history`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Billing_historyRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyResponse.cs new file mode 100644 index 0000000..b2edbc7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Billing_history/Billing_historyResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history +{ + [Obsolete("This class is obsolete. Use Billing_historyGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Billing_historyResponse : global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesGetResponse.cs new file mode 100644 index 0000000..0a1333c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesGetResponse.cs @@ -0,0 +1,96 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class InvoicesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The invoice preview. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Invoice_preview? InvoicePreview { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Invoice_preview InvoicePreview { get; set; } +#endif + /// The invoices property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Invoices { get; set; } +#nullable restore +#else + public List Invoices { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public InvoicesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "invoice_preview", n => { InvoicePreview = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Invoice_preview.CreateFromDiscriminatorValue); } }, + { "invoices", n => { Invoices = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Invoice_preview.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("invoice_preview", InvoicePreview); + writer.WriteCollectionOfObjectValues("invoices", Invoices); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesRequestBuilder.cs new file mode 100644 index 0000000..a072bce --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesRequestBuilder.cs @@ -0,0 +1,159 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices +{ + /// + /// Builds and executes requests for operations under \v2\customers\my\invoices + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class InvoicesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.customers.my.invoices.item collection + /// UUID of the invoice + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("invoice_uuid", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InvoicesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InvoicesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve a list of all invoices, send a GET request to `/v2/customers/my/invoices`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsInvoicesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsInvoicesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all invoices, send a GET request to `/v2/customers/my/invoices`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsInvoicesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all invoices, send a GET request to `/v2/customers/my/invoices`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve a list of all invoices, send a GET request to `/v2/customers/my/invoices`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class InvoicesRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class InvoicesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesResponse.cs new file mode 100644 index 0000000..7d3932d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/InvoicesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices +{ + [Obsolete("This class is obsolete. Use InvoicesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class InvoicesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/CsvEscaped/CsvRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/CsvEscaped/CsvRequestBuilder.cs new file mode 100644 index 0000000..35be5f2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/CsvEscaped/CsvRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.CsvEscaped +{ + /// + /// Builds and executes requests for operations under \v2\customers\my\invoices\{invoice_uuid}\csv + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CsvRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CsvRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}/csv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CsvRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}/csv", rawUrl) + { + } + /// + /// To retrieve a CSV for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID/csv`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a CSV for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID/csv`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/csv, application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.CsvEscaped.CsvRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.CsvEscaped.CsvRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CsvRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/Pdf/PdfRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/Pdf/PdfRequestBuilder.cs new file mode 100644 index 0000000..8f075b7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/Pdf/PdfRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Pdf +{ + /// + /// Builds and executes requests for operations under \v2\customers\my\invoices\{invoice_uuid}\pdf + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PdfRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PdfRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}/pdf", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PdfRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}/pdf", rawUrl) + { + } + /// + /// To retrieve a PDF for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID/pdf`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a PDF for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID/pdf`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/pdf, application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Pdf.PdfRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Pdf.PdfRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PdfRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/Summary/SummaryRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/Summary/SummaryRequestBuilder.cs new file mode 100644 index 0000000..88206d4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/Summary/SummaryRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Summary +{ + /// + /// Builds and executes requests for operations under \v2\customers\my\invoices\{invoice_uuid}\summary + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SummaryRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SummaryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}/summary", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SummaryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}/summary", rawUrl) + { + } + /// + /// To retrieve a summary for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID/summary`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Invoice_summary.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a summary for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID/summary`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Summary.SummaryRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Summary.SummaryRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SummaryRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuGetResponse.cs new file mode 100644 index 0000000..abe57f5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithInvoice_uuGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The invoice_items property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? InvoiceItems { get; set; } +#nullable restore +#else + public List InvoiceItems { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithInvoice_uuGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "invoice_items", n => { InvoiceItems = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Invoice_item.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("invoice_items", InvoiceItems); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuItemRequestBuilder.cs new file mode 100644 index 0000000..ba852be --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuItemRequestBuilder.cs @@ -0,0 +1,168 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.CsvEscaped; +using InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Pdf; +using InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Summary; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item +{ + /// + /// Builds and executes requests for operations under \v2\customers\my\invoices\{invoice_uuid} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithInvoice_uuItemRequestBuilder : BaseRequestBuilder + { + /// The csv property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.CsvEscaped.CsvRequestBuilder Csv + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.CsvEscaped.CsvRequestBuilder(PathParameters, RequestAdapter); + } + /// The pdf property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Pdf.PdfRequestBuilder Pdf + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Pdf.PdfRequestBuilder(PathParameters, RequestAdapter); + } + /// The summary property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Summary.SummaryRequestBuilder Summary + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.Summary.SummaryRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithInvoice_uuItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithInvoice_uuItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my/invoices/{invoice_uuid}{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve the invoice items for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithInvoice_uuGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithInvoice_uuGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the invoice items for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithInvoice_uuGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the invoice items for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve the invoice items for an invoice, send a GET request to `/v2/customers/my/invoices/$INVOICE_UUID`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithInvoice_uuItemRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithInvoice_uuItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuResponse.cs new file mode 100644 index 0000000..b276610 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/Invoices/Item/WithInvoice_uuResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item +{ + [Obsolete("This class is obsolete. Use WithInvoice_uuGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithInvoice_uuResponse : global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.Item.WithInvoice_uuResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/MyRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/MyRequestBuilder.cs new file mode 100644 index 0000000..97a3f66 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Customers/My/MyRequestBuilder.cs @@ -0,0 +1,53 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Customers.My.Balance; +using InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history; +using InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Customers.My +{ + /// + /// Builds and executes requests for operations under \v2\customers\my + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MyRequestBuilder : BaseRequestBuilder + { + /// The balance property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Balance.BalanceRequestBuilder Balance + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Balance.BalanceRequestBuilder(PathParameters, RequestAdapter); + } + /// The billing_history property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyRequestBuilder Billing_history + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Billing_history.Billing_historyRequestBuilder(PathParameters, RequestAdapter); + } + /// The invoices property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesRequestBuilder Invoices + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.My.Invoices.InvoicesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/customers/my", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Database_cluster.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Database_cluster.cs new file mode 100644 index 0000000..70e01c9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Database_cluster.cs @@ -0,0 +1,57 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class Database_cluster : global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster, IParsable + #pragma warning restore CS1591 + { + /// The backup_restore property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_backup? BackupRestore { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_backup BackupRestore { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Database_cluster CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Database_cluster(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "backup_restore", n => { BackupRestore = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_backup.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("backup_restore", BackupRestore); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesGetResponse.cs new file mode 100644 index 0000000..8d87af8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DatabasesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The databases property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Databases { get; set; } +#nullable restore +#else + public List Databases { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DatabasesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "databases", n => { Databases = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("databases", Databases); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesPostRequestBody.cs new file mode 100644 index 0000000..6a42341 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesPostRequestBody.cs @@ -0,0 +1,57 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DatabasesPostRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster, IParsable + #pragma warning restore CS1591 + { + /// The backup_restore property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_backup? BackupRestore { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_backup BackupRestore { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "backup_restore", n => { BackupRestore = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_backup.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("backup_restore", BackupRestore); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesPostResponse.cs new file mode 100644 index 0000000..2d031a0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DatabasesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster? Database { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster Database { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DatabasesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "database", n => { Database = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("database", Database); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesRequestBuilder.cs new file mode 100644 index 0000000..ec309bc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesRequestBuilder.cs @@ -0,0 +1,289 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Options; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases +{ + /// + /// Builds and executes requests for operations under \v2\databases + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DatabasesRequestBuilder : BaseRequestBuilder + { + /// The metrics property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.MetricsRequestBuilder Metrics + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter); + } + /// The optionsPath property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Options.OptionsRequestBuilder OptionsPath + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Options.OptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item collection + /// A unique identifier for a database cluster. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("database_cluster_uuid", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item collection + /// A unique identifier for a database cluster. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("database_cluster_uuid", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DatabasesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases{?tag_name*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DatabasesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases{?tag_name*}", rawUrl) + { + } + /// + /// To list all of the database clusters available on your account, send a GET request to `/v2/databases`. To limit the results to database clusters with a specific tag, include the `tag_name` query parameter set to the name of the tag. For example, `/v2/databases?tag_name=$TAG_NAME`.The result will be a JSON object with a `databases` key. This will be set to an array of database objects, each of which will contain the standard database attributes.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects will contain the information needed to connect to the cluster's standby node(s).The embedded `maintenance_window` object will contain information about any scheduled maintenance for the database cluster. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDatabasesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDatabasesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the database clusters available on your account, send a GET request to `/v2/databases`. To limit the results to database clusters with a specific tag, include the `tag_name` query parameter set to the name of the tag. For example, `/v2/databases?tag_name=$TAG_NAME`.The result will be a JSON object with a `databases` key. This will be set to an array of database objects, each of which will contain the standard database attributes.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects will contain the information needed to connect to the cluster's standby node(s).The embedded `maintenance_window` object will contain information about any scheduled maintenance for the database cluster. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDatabasesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a database cluster, send a POST request to `/v2/databases`.The response will be a JSON object with a key called `database`. The value of this will be an object that contains the standard attributes associated with a database cluster. The initial value of the database cluster's `status` attribute will be `creating`. When the cluster is ready to receive traffic, this will transition to `online`.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects will contain the information needed to connect to the cluster's standby node(s).DigitalOcean managed PostgreSQL and MySQL database clusters take automated daily backups. To create a new database cluster based on a backup of an existing cluster, send a POST request to `/v2/databases`. In addition to the standard database cluster attributes, the JSON body must include a key named `backup_restore` with the name of the original database cluster and the timestamp of the backup to be restored. Creating a database from a backup is the same as forking a database in the control panel.Note: Backups are not supported for Redis clusters. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsDatabasesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsDatabasesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a database cluster, send a POST request to `/v2/databases`.The response will be a JSON object with a key called `database`. The value of this will be an object that contains the standard attributes associated with a database cluster. The initial value of the database cluster's `status` attribute will be `creating`. When the cluster is ready to receive traffic, this will transition to `online`.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects will contain the information needed to connect to the cluster's standby node(s).DigitalOcean managed PostgreSQL and MySQL database clusters take automated daily backups. To create a new database cluster based on a backup of an existing cluster, send a POST request to `/v2/databases`. In addition to the standard database cluster attributes, the JSON body must include a key named `backup_restore` with the name of the original database cluster and the timestamp of the backup to be restored. Creating a database from a backup is the same as forking a database in the control panel.Note: Backups are not supported for Redis clusters. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsDatabasesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the database clusters available on your account, send a GET request to `/v2/databases`. To limit the results to database clusters with a specific tag, include the `tag_name` query parameter set to the name of the tag. For example, `/v2/databases?tag_name=$TAG_NAME`.The result will be a JSON object with a `databases` key. This will be set to an array of database objects, each of which will contain the standard database attributes.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects will contain the information needed to connect to the cluster's standby node(s).The embedded `maintenance_window` object will contain information about any scheduled maintenance for the database cluster. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a database cluster, send a POST request to `/v2/databases`.The response will be a JSON object with a key called `database`. The value of this will be an object that contains the standard attributes associated with a database cluster. The initial value of the database cluster's `status` attribute will be `creating`. When the cluster is ready to receive traffic, this will transition to `online`.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects will contain the information needed to connect to the cluster's standby node(s).DigitalOcean managed PostgreSQL and MySQL database clusters take automated daily backups. To create a new database cluster based on a backup of an existing cluster, send a POST request to `/v2/databases`. In addition to the standard database cluster attributes, the JSON body must include a key named `backup_restore` with the name of the original database cluster and the timestamp of the backup to be restored. Creating a database from a backup is the same as forking a database in the control panel.Note: Backups are not supported for Redis clusters. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the database clusters available on your account, send a GET request to `/v2/databases`. To limit the results to database clusters with a specific tag, include the `tag_name` query parameter set to the name of the tag. For example, `/v2/databases?tag_name=$TAG_NAME`.The result will be a JSON object with a `databases` key. This will be set to an array of database objects, each of which will contain the standard database attributes.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects will contain the information needed to connect to the cluster's standby node(s).The embedded `maintenance_window` object will contain information about any scheduled maintenance for the database cluster. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DatabasesRequestBuilderGetQueryParameters + { + /// Limits the results to database clusters with a specific tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag_name")] + public string? TagName { get; set; } +#nullable restore +#else + [QueryParameter("tag_name")] + public string TagName { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DatabasesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DatabasesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesResponse.cs new file mode 100644 index 0000000..a8a65e3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/DatabasesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases +{ + [Obsolete("This class is obsolete. Use DatabasesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DatabasesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaGetResponse.cs new file mode 100644 index 0000000..e513891 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CaGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ca property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Ca? Ca { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Ca Ca { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CaGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ca", n => { Ca = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Ca.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("ca", Ca); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaRequestBuilder.cs new file mode 100644 index 0000000..625dd72 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\ca + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CaRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CaRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/ca", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CaRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/ca", rawUrl) + { + } + /// + /// To retrieve the public certificate used to secure the connection to the database cluster send a GET request to`/v2/databases/$DATABASE_ID/ca`.The response will be a JSON object with a `ca` key. This will be set to an objectcontaining the base64 encoding of the public key certificate. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsCaGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsCaGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the public certificate used to secure the connection to the database cluster send a GET request to`/v2/databases/$DATABASE_ID/ca`.The response will be a JSON object with a `ca` key. This will be set to an objectcontaining the base64 encoding of the public key certificate. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsCaGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the public certificate used to secure the connection to the database cluster send a GET request to`/v2/databases/$DATABASE_ID/ca`.The response will be a JSON object with a `ca` key. This will be set to an objectcontaining the base64 encoding of the public key certificate. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CaRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaResponse.cs new file mode 100644 index 0000000..b198534 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Ca/CaResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca +{ + [Obsolete("This class is obsolete. Use CaGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CaResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigGetResponse.cs new file mode 100644 index 0000000..38ea7d0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigGetResponse.cs @@ -0,0 +1,159 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ConfigGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse.ConfigGetResponse_config? Config { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse.ConfigGetResponse_config Config { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ConfigGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "config", n => { Config = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse.ConfigGetResponse_config.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("config", Config); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes , , , , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ConfigGetResponse_config : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config? KafkaAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config KafkaAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config? MongoAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config MongoAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config? MysqlAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config MysqlAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config? OpensearchAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config OpensearchAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config? PostgresAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config PostgresAdvancedConfig { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config? RedisAdvancedConfig { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config RedisAdvancedConfig { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse.ConfigGetResponse_config CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse.ConfigGetResponse_config(); + result.KafkaAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Kafka_advanced_config(); + result.MongoAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Mongo_advanced_config(); + result.MysqlAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Mysql_advanced_config(); + result.OpensearchAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_advanced_config(); + result.PostgresAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Postgres_advanced_config(); + result.RedisAdvancedConfig = new global::InfinityFlow.DigitalOcean.Client.Models.Redis_advanced_config(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(KafkaAdvancedConfig != null || MongoAdvancedConfig != null || MysqlAdvancedConfig != null || OpensearchAdvancedConfig != null || PostgresAdvancedConfig != null || RedisAdvancedConfig != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(KafkaAdvancedConfig, MongoAdvancedConfig, MysqlAdvancedConfig, OpensearchAdvancedConfig, PostgresAdvancedConfig, RedisAdvancedConfig); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, KafkaAdvancedConfig, MongoAdvancedConfig, MysqlAdvancedConfig, OpensearchAdvancedConfig, PostgresAdvancedConfig, RedisAdvancedConfig); + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigRequestBuilder.cs new file mode 100644 index 0000000..81985f5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigRequestBuilder.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\config + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ConfigRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/config", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/config", rawUrl) + { + } + /// + /// Shows configuration parameters for an existing database cluster by sending a GET request to`/v2/databases/$DATABASE_ID/config`.The response is a JSON object with a `config` key, which is set to an objectcontaining any database configuration parameters. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsConfigGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsConfigGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Shows configuration parameters for an existing database cluster by sending a GET request to`/v2/databases/$DATABASE_ID/config`.The response is a JSON object with a `config` key, which is set to an objectcontaining any database configuration parameters. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsConfigGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the configuration for an existing database cluster, send a PATCH request to`/v2/databases/$DATABASE_ID/config`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_config body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_config body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Shows configuration parameters for an existing database cluster by sending a GET request to`/v2/databases/$DATABASE_ID/config`.The response is a JSON object with a `config` key, which is set to an objectcontaining any database configuration parameters. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the configuration for an existing database cluster, send a PATCH request to`/v2/databases/$DATABASE_ID/config`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_config body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_config body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ConfigRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ConfigRequestBuilderPatchRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigResponse.cs new file mode 100644 index 0000000..3b5380c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Config/ConfigResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config +{ + [Obsolete("This class is obsolete. Use ConfigGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ConfigResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsGetResponse.cs new file mode 100644 index 0000000..cb83428 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DbsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The dbs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Dbs { get; set; } +#nullable restore +#else + public List Dbs { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DbsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "dbs", n => { Dbs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("dbs", Dbs); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsPostResponse.cs new file mode 100644 index 0000000..467fe4e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DbsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The db property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database? Db { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database Db { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DbsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "db", n => { Db = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("db", Db); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsRequestBuilder.cs new file mode 100644 index 0000000..cc49157 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\dbs + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DbsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.dbs.item collection + /// The name of the database. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("database_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DbsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/dbs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DbsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/dbs", rawUrl) + { + } + /// + /// To list all of the databases in a clusters, send a GET request to`/v2/databases/$DATABASE_ID/dbs`.The result will be a JSON object with a `dbs` key. This will be set to an arrayof database objects, each of which will contain the standard database attributes.Note: Database management is not supported for Redis clusters. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDbsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDbsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the databases in a clusters, send a GET request to`/v2/databases/$DATABASE_ID/dbs`.The result will be a JSON object with a `dbs` key. This will be set to an arrayof database objects, each of which will contain the standard database attributes.Note: Database management is not supported for Redis clusters. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDbsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add a new database to an existing cluster, send a POST request to`/v2/databases/$DATABASE_ID/dbs`.Note: Database management is not supported for Redis clusters.The response will be a JSON object with a key called `db`. The value of this will bean object that contains the standard attributes associated with a database. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsDbsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsDbsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add a new database to an existing cluster, send a POST request to`/v2/databases/$DATABASE_ID/dbs`.Note: Database management is not supported for Redis clusters.The response will be a JSON object with a key called `db`. The value of this will bean object that contains the standard attributes associated with a database. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsDbsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the databases in a clusters, send a GET request to`/v2/databases/$DATABASE_ID/dbs`.The result will be a JSON object with a `dbs` key. This will be set to an arrayof database objects, each of which will contain the standard database attributes.Note: Database management is not supported for Redis clusters. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To add a new database to an existing cluster, send a POST request to`/v2/databases/$DATABASE_ID/dbs`.Note: Database management is not supported for Redis clusters.The response will be a JSON object with a key called `db`. The value of this will bean object that contains the standard attributes associated with a database. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DbsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DbsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsResponse.cs new file mode 100644 index 0000000..eb4fad2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/DbsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs +{ + [Obsolete("This class is obsolete. Use DbsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DbsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameGetResponse.cs new file mode 100644 index 0000000..1598101 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDatabase_nameGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The db property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database? Db { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database Db { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDatabase_nameGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "db", n => { Db = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("db", Db); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameItemRequestBuilder.cs new file mode 100644 index 0000000..59fdd1d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameItemRequestBuilder.cs @@ -0,0 +1,194 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\dbs\{database_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDatabase_nameItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDatabase_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/dbs/{database_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDatabase_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/dbs/{database_name}", rawUrl) + { + } + /// + /// To delete a specific database, send a DELETE request to`/v2/databases/$DATABASE_ID/dbs/$DB_NAME`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed.Note: Database management is not supported for Redis clusters. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database cluster, send a GET request to`/v2/databases/$DATABASE_ID/dbs/$DB_NAME`.Note: Database management is not supported for Redis clusters.The response will be a JSON object with a `db` key. This will be set to an objectcontaining the standard database attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithDatabase_nameGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithDatabase_nameGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database cluster, send a GET request to`/v2/databases/$DATABASE_ID/dbs/$DB_NAME`.Note: Database management is not supported for Redis clusters.The response will be a JSON object with a `db` key. This will be set to an objectcontaining the standard database attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithDatabase_nameGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a specific database, send a DELETE request to`/v2/databases/$DATABASE_ID/dbs/$DB_NAME`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed.Note: Database management is not supported for Redis clusters. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing database cluster, send a GET request to`/v2/databases/$DATABASE_ID/dbs/$DB_NAME`.Note: Database management is not supported for Redis clusters.The response will be a JSON object with a `db` key. This will be set to an objectcontaining the standard database attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDatabase_nameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDatabase_nameItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameResponse.cs new file mode 100644 index 0000000..5f8ea73 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Dbs/Item/WithDatabase_nameResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item +{ + [Obsolete("This class is obsolete. Use WithDatabase_nameGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDatabase_nameResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.Item.WithDatabase_nameResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsGetResponse.cs new file mode 100644 index 0000000..a0fc593 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class EventsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The events property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Events { get; set; } +#nullable restore +#else + public List Events { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EventsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "events", n => { Events = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Events_logs.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("events", Events); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsRequestBuilder.cs new file mode 100644 index 0000000..8b2eb6e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\events + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class EventsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EventsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/events", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EventsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/events", rawUrl) + { + } + /// + /// To list all of the cluster events, send a GET request to`/v2/databases/$DATABASE_ID/events`.The result will be a JSON object with a `events` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsEventsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsEventsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the cluster events, send a GET request to`/v2/databases/$DATABASE_ID/events`.The result will be a JSON object with a `events` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsEventsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the cluster events, send a GET request to`/v2/databases/$DATABASE_ID/events`.The result will be a JSON object with a `events` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class EventsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsResponse.cs new file mode 100644 index 0000000..98fd7bf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Events/EventsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events +{ + [Obsolete("This class is obsolete. Use EventsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class EventsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyGetResponse.cs new file mode 100644 index 0000000..71289a4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyGetResponse.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Eviction_policyGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A string specifying the desired eviction policy for the Redis cluster.- `noeviction`: Don't evict any data, returns error when memory limit is reached.- `allkeys_lru:` Evict any key, least recently used (LRU) first.- `allkeys_random`: Evict keys in a random order.- `volatile_lru`: Evict keys with expiration only, least recently used (LRU) first.- `volatile_random`: Evict keys with expiration only in a random order.- `volatile_ttl`: Evict keys with expiration only, shortest time-to-live (TTL) first. + public global::InfinityFlow.DigitalOcean.Client.Models.Eviction_policy_model? EvictionPolicy { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Eviction_policyGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "eviction_policy", n => { EvictionPolicy = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("eviction_policy", EvictionPolicy); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyPutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyPutRequestBody.cs new file mode 100644 index 0000000..3d9f350 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyPutRequestBody.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Eviction_policyPutRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A string specifying the desired eviction policy for the Redis cluster.- `noeviction`: Don't evict any data, returns error when memory limit is reached.- `allkeys_lru:` Evict any key, least recently used (LRU) first.- `allkeys_random`: Evict keys in a random order.- `volatile_lru`: Evict keys with expiration only, least recently used (LRU) first.- `volatile_random`: Evict keys with expiration only in a random order.- `volatile_ttl`: Evict keys with expiration only, shortest time-to-live (TTL) first. + public global::InfinityFlow.DigitalOcean.Client.Models.Eviction_policy_model? EvictionPolicy { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public Eviction_policyPutRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyPutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyPutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "eviction_policy", n => { EvictionPolicy = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("eviction_policy", EvictionPolicy); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyRequestBuilder.cs new file mode 100644 index 0000000..2ba9e79 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyRequestBuilder.cs @@ -0,0 +1,199 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\eviction_policy + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Eviction_policyRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Eviction_policyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/eviction_policy", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Eviction_policyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/eviction_policy", rawUrl) + { + } + /// + /// To retrieve the configured eviction policy for an existing Redis cluster, send a GET request to `/v2/databases/$DATABASE_ID/eviction_policy`.The response will be a JSON object with an `eviction_policy` key. This will be set to a string representing the eviction policy. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsEviction_policyGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsEviction_policyGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the configured eviction policy for an existing Redis cluster, send a GET request to `/v2/databases/$DATABASE_ID/eviction_policy`.The response will be a JSON object with an `eviction_policy` key. This will be set to a string representing the eviction policy. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsEviction_policyGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To configure an eviction policy for an existing Redis cluster, send a PUT request to `/v2/databases/$DATABASE_ID/eviction_policy` specifying the desired policy. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the configured eviction policy for an existing Redis cluster, send a GET request to `/v2/databases/$DATABASE_ID/eviction_policy`.The response will be a JSON object with an `eviction_policy` key. This will be set to a string representing the eviction policy. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To configure an eviction policy for an existing Redis cluster, send a PUT request to `/v2/databases/$DATABASE_ID/eviction_policy` specifying the desired policy. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyPutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyPutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Eviction_policyRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Eviction_policyRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyResponse.cs new file mode 100644 index 0000000..c2603b0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Eviction_policy/Eviction_policyResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy +{ + [Obsolete("This class is obsolete. Use Eviction_policyGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Eviction_policyResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallGetResponse.cs new file mode 100644 index 0000000..39af0f6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The rules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Rules { get; set; } +#nullable restore +#else + public List Rules { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FirewallGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "rules", n => { Rules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("rules", Rules); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallPutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallPutRequestBody.cs new file mode 100644 index 0000000..bb5b61f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallPutRequestBody.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallPutRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The rules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Rules { get; set; } +#nullable restore +#else + public List Rules { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FirewallPutRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallPutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallPutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "rules", n => { Rules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rule.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("rules", Rules); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallRequestBuilder.cs new file mode 100644 index 0000000..b0403ec --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallRequestBuilder.cs @@ -0,0 +1,199 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\firewall + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FirewallRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/firewall", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FirewallRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/firewall", rawUrl) + { + } + /// + /// To list all of a database cluster's firewall rules (known as "trusted sources" in the control panel), send a GET request to `/v2/databases/$DATABASE_ID/firewall`.The result will be a JSON object with a `rules` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsFirewallGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsFirewallGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a database cluster's firewall rules (known as "trusted sources" in the control panel), send a GET request to `/v2/databases/$DATABASE_ID/firewall`.The result will be a JSON object with a `rules` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsFirewallGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a database cluster's firewall rules (known as "trusted sources" in the control panel), send a PUT request to `/v2/databases/$DATABASE_ID/firewall` specifying which resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 rules (or trusted sources). When possible, we recommend [placing your databases into a VPC network](https://docs.digitalocean.com/products/networking/vpc/) to limit access to them instead of using a firewall.A successful + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a database cluster's firewall rules (known as "trusted sources" in the control panel), send a GET request to `/v2/databases/$DATABASE_ID/firewall`.The result will be a JSON object with a `rules` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update a database cluster's firewall rules (known as "trusted sources" in the control panel), send a PUT request to `/v2/databases/$DATABASE_ID/firewall` specifying which resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 rules (or trusted sources). When possible, we recommend [placing your databases into a VPC network](https://docs.digitalocean.com/products/networking/vpc/) to limit access to them instead of using a firewall.A successful + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallPutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallPutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallResponse.cs new file mode 100644 index 0000000..6302bd8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Firewall/FirewallResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall +{ + [Obsolete("This class is obsolete. Use FirewallGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesGetResponse.cs new file mode 100644 index 0000000..1d3cf26 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IndexesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The indexes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Indexes { get; set; } +#nullable restore +#else + public List Indexes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IndexesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "indexes", n => { Indexes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Opensearch_index.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("indexes", Indexes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesRequestBuilder.cs new file mode 100644 index 0000000..185f71c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\indexes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IndexesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.indexes.item collection + /// The name of the OpenSearch index. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.Item.WithIndex_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("index_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.Item.WithIndex_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IndexesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/indexes", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public IndexesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/indexes", rawUrl) + { + } + /// + /// To list all of a OpenSearch cluster's indexes, send a GET request to`/v2/databases/$DATABASE_ID/indexes`.The result will be a JSON object with a `indexes` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsIndexesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsIndexesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a OpenSearch cluster's indexes, send a GET request to`/v2/databases/$DATABASE_ID/indexes`.The result will be a JSON object with a `indexes` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsIndexesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a OpenSearch cluster's indexes, send a GET request to`/v2/databases/$DATABASE_ID/indexes`.The result will be a JSON object with a `indexes` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IndexesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesResponse.cs new file mode 100644 index 0000000..7c850d2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/IndexesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes +{ + [Obsolete("This class is obsolete. Use IndexesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IndexesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/Item/WithIndex_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/Item/WithIndex_nameItemRequestBuilder.cs new file mode 100644 index 0000000..10a31fd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Indexes/Item/WithIndex_nameItemRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\indexes\{index_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithIndex_nameItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithIndex_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/indexes/{index_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithIndex_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/indexes/{index_name}", rawUrl) + { + } + /// + /// To delete a single index within OpenSearch cluster, send a DELETE requestto `/v2/databases/$DATABASE_ID/indexes/$INDEX_NAME`.A status of 204 will be given. This indicates that the request wasprocessed successfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a single index within OpenSearch cluster, send a DELETE requestto `/v2/databases/$DATABASE_ID/indexes/$INDEX_NAME`.A status of 204 will be given. This indicates that the request wasprocessed successfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.Item.WithIndex_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.Item.WithIndex_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithIndex_nameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Install_update/Install_updateRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Install_update/Install_updateRequestBuilder.cs new file mode 100644 index 0000000..23bbf3c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Install_update/Install_updateRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Install_update +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\install_update + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Install_updateRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Install_updateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/install_update", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Install_updateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/install_update", rawUrl) + { + } + /// + /// To start the installation of updates for a database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/install_update`.A successful request will receive a 204 No Content status code with no body in response. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPutRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To start the installation of updates for a database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/install_update`.A successful request will receive a 204 No Content status code with no body in response. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Install_update.Install_updateRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Install_update.Install_updateRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Install_updateRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_GetResponse.cs new file mode 100644 index 0000000..305190b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithLogsink_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The sink property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose? Sink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose Sink { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithLogsink_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sink", n => { Sink = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("sink", Sink); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_ItemRequestBuilder.cs new file mode 100644 index 0000000..04e2381 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_ItemRequestBuilder.cs @@ -0,0 +1,258 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\logsink\{logsink_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLogsink_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithLogsink_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/logsink/{logsink_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithLogsink_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/logsink/{logsink_id}", rawUrl) + { + } + /// + /// To delete a logsink for a database cluster, send a DELETE request to`/v2/databases/$DATABASE_ID/logsink/$LOGSINK_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get a logsink for a database cluster, send a GET request to`/v2/databases/$DATABASE_ID/logsink/$LOGSINK_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithLogsink_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithLogsink_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get a logsink for a database cluster, send a GET request to`/v2/databases/$DATABASE_ID/logsink/$LOGSINK_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithLogsink_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a logsink for a database cluster, send a PUT request to`/v2/databases/$DATABASE_ID/logsink/$LOGSINK_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a logsink for a database cluster, send a DELETE request to`/v2/databases/$DATABASE_ID/logsink/$LOGSINK_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To get a logsink for a database cluster, send a GET request to`/v2/databases/$DATABASE_ID/logsink/$LOGSINK_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update a logsink for a database cluster, send a PUT request to`/v2/databases/$DATABASE_ID/logsink/$LOGSINK_ID`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_update body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLogsink_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLogsink_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLogsink_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_Response.cs new file mode 100644 index 0000000..8b3a95d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/Item/WithLogsink_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item +{ + [Obsolete("This class is obsolete. Use WithLogsink_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithLogsink_Response : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkGetResponse.cs new file mode 100644 index 0000000..0a905f6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class LogsinkGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The sinks property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Sinks { get; set; } +#nullable restore +#else + public List Sinks { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LogsinkGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sinks", n => { Sinks = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("sinks", Sinks); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkPostResponse.cs new file mode 100644 index 0000000..663c51c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class LogsinkPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The sink property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose? Sink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose Sink { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LogsinkPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sink", n => { Sink = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_verbose.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("sink", Sink); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkRequestBuilder.cs new file mode 100644 index 0000000..727b634 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\logsink + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class LogsinkRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.logsink.item collection + /// A unique identifier for a logsink of a database cluster + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("logsink_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.Item.WithLogsink_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LogsinkRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/logsink", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LogsinkRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/logsink", rawUrl) + { + } + /// + /// To list logsinks for a database cluster, send a GET request to`/v2/databases/$DATABASE_ID/logsink`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsLogsinkGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsLogsinkGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list logsinks for a database cluster, send a GET request to`/v2/databases/$DATABASE_ID/logsink`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsLogsinkGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create logsink for a database cluster, send a POST request to`/v2/databases/$DATABASE_ID/logsink`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsLogsinkPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsLogsinkPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create logsink for a database cluster, send a POST request to`/v2/databases/$DATABASE_ID/logsink`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsLogsinkPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list logsinks for a database cluster, send a GET request to`/v2/databases/$DATABASE_ID/logsink`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create logsink for a database cluster, send a POST request to`/v2/databases/$DATABASE_ID/logsink`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Logsink_create body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class LogsinkRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class LogsinkRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkResponse.cs new file mode 100644 index 0000000..8c4ba11 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Logsink/LogsinkResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink +{ + [Obsolete("This class is obsolete. Use LogsinkGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class LogsinkResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Maintenance/MaintenanceRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Maintenance/MaintenanceRequestBuilder.cs new file mode 100644 index 0000000..6088152 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Maintenance/MaintenanceRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Maintenance +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\maintenance + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MaintenanceRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MaintenanceRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/maintenance", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MaintenanceRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/maintenance", rawUrl) + { + } + /// + /// To configure the window when automatic maintenance should be performed for a database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/maintenance`.A successful request will receive a 204 No Content status code with no body in response. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To configure the window when automatic maintenance should be performed for a database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/maintenance`.A successful request will receive a 204 No Content status code with no body in response. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_maintenance_window body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Maintenance.MaintenanceRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Maintenance.MaintenanceRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MaintenanceRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Migrate/MigratePutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Migrate/MigratePutRequestBody.cs new file mode 100644 index 0000000..5e18f49 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Migrate/MigratePutRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class MigratePutRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A slug identifier for the region to which the database cluster will be migrated. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MigratePutRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigratePutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigratePutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "region", n => { Region = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("region", Region); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Migrate/MigrateRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Migrate/MigrateRequestBuilder.cs new file mode 100644 index 0000000..aa25c9f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Migrate/MigrateRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\migrate + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MigrateRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MigrateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/migrate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MigrateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/migrate", rawUrl) + { + } + /// + /// To migrate a database cluster to a new region, send a `PUT` request to`/v2/databases/$DATABASE_ID/migrate`. The body of the request must specify a`region` attribute.A successful request will receive a 202 Accepted status code with no body inresponse. Querying the database cluster will show that its `status` attributewill now be set to `migrating`. This will transition back to `online` when themigration has completed. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigratePutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigratePutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To migrate a database cluster to a new region, send a `PUT` request to`/v2/databases/$DATABASE_ID/migrate`. The body of the request must specify a`region` attribute.A successful request will receive a 202 Accepted status code with no body inresponse. Querying the database cluster will show that its `status` attributewill now be set to `migrating`. This will transition back to `online` when themigration has completed. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigratePutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigratePutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigrateRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigrateRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MigrateRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/OnlineMigration/Item/WithMigration_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/OnlineMigration/Item/WithMigration_ItemRequestBuilder.cs new file mode 100644 index 0000000..fd5dcdd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/OnlineMigration/Item/WithMigration_ItemRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\online-migration\{migration_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithMigration_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithMigration_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/online-migration/{migration_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithMigration_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/online-migration/{migration_id}", rawUrl) + { + } + /// + /// To stop an online migration, send a DELETE request to `/v2/databases/$DATABASE_ID/online-migration/$MIGRATION_ID`.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To stop an online migration, send a DELETE request to `/v2/databases/$DATABASE_ID/online-migration/$MIGRATION_ID`.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.Item.WithMigration_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.Item.WithMigration_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithMigration_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/OnlineMigration/OnlineMigrationRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/OnlineMigration/OnlineMigrationRequestBuilder.cs new file mode 100644 index 0000000..dc95fd3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/OnlineMigration/OnlineMigrationRequestBuilder.cs @@ -0,0 +1,181 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\online-migration + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OnlineMigrationRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.onlineMigration.item collection + /// A unique identifier assigned to the online migration. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.Item.WithMigration_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("migration_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.Item.WithMigration_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OnlineMigrationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/online-migration", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OnlineMigrationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/online-migration", rawUrl) + { + } + /// + /// To retrieve the status of the most recent online migration, send a GET request to `/v2/databases/$DATABASE_ID/online-migration`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Online_migration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To start an online migration, send a PUT request to `/v2/databases/$DATABASE_ID/online-migration` endpoint. Migrating a cluster establishes a connection with an existing cluster and replicates its contents to the target cluster. Online migration is only available for MySQL, PostgreSQL, and Redis clusters. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Source_database body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Source_database body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Online_migration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of the most recent online migration, send a GET request to `/v2/databases/$DATABASE_ID/online-migration`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To start an online migration, send a PUT request to `/v2/databases/$DATABASE_ID/online-migration` endpoint. Migrating a cluster establishes a connection with an existing cluster and replicates its contents to the target cluster. Online migration is only available for MySQL, PostgreSQL, and Redis clusters. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Source_database body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Source_database body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.OnlineMigrationRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.OnlineMigrationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OnlineMigrationRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OnlineMigrationRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameGetResponse.cs new file mode 100644 index 0000000..65a05a1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithPool_nameGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The pool property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool? Pool { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool Pool { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithPool_nameGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "pool", n => { Pool = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("pool", Pool); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameItemRequestBuilder.cs new file mode 100644 index 0000000..a408c36 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameItemRequestBuilder.cs @@ -0,0 +1,256 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\pools\{pool_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithPool_nameItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithPool_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/pools/{pool_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithPool_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/pools/{pool_name}", rawUrl) + { + } + /// + /// To delete a specific connection pool for a PostgreSQL database cluster, senda DELETE request to `/v2/databases/$DATABASE_ID/pools/$POOL_NAME`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing connection pool for a PostgreSQL database cluster, send a GET request to `/v2/databases/$DATABASE_ID/pools/$POOL_NAME`.The response will be a JSON object with a `pool` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithPool_nameGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithPool_nameGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing connection pool for a PostgreSQL database cluster, send a GET request to `/v2/databases/$DATABASE_ID/pools/$POOL_NAME`.The response will be a JSON object with a `pool` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithPool_nameGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a connection pool for a PostgreSQL database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/pools/$POOL_NAME`. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a specific connection pool for a PostgreSQL database cluster, senda DELETE request to `/v2/databases/$DATABASE_ID/pools/$POOL_NAME`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing connection pool for a PostgreSQL database cluster, send a GET request to `/v2/databases/$DATABASE_ID/pools/$POOL_NAME`.The response will be a JSON object with a `pool` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update a connection pool for a PostgreSQL database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/pools/$POOL_NAME`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool_update body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool_update body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithPool_nameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithPool_nameItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithPool_nameItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameResponse.cs new file mode 100644 index 0000000..a0812c9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/Item/WithPool_nameResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item +{ + [Obsolete("This class is obsolete. Use WithPool_nameGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithPool_nameResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsPostResponse.cs new file mode 100644 index 0000000..a7a3a91 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PoolsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The pool property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool? Pool { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool Pool { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PoolsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "pool", n => { Pool = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("pool", Pool); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsRequestBuilder.cs new file mode 100644 index 0000000..5769159 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsRequestBuilder.cs @@ -0,0 +1,215 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\pools + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PoolsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.pools.item collection + /// The name used to identify the connection pool. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("pool_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.Item.WithPool_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PoolsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/pools", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PoolsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/pools", rawUrl) + { + } + /// + /// To list all of the connection pools available to a PostgreSQL database cluster, send a GET request to `/v2/databases/$DATABASE_ID/pools`.The result will be a JSON object with a `pools` key. This will be set to an array of connection pool objects. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Connection_pools.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// For PostgreSQL database clusters, connection pools can be used to allow adatabase to share its idle connections. The popular PostgreSQL connectionpooling utility PgBouncer is used to provide this service. [See here for more information](https://docs.digitalocean.com/products/databases/postgresql/how-to/manage-connection-pools/)about how and why to use PgBouncer connection pooling includingdetails about the available transaction modes.To add a new connection pool to a PostgreSQL database cluster, send a POSTrequest to `/v2/databases/$DATABASE_ID/pools` specifying a name for the pool,the user to connect with, the database to connect to, as well as its desiredsize and transaction mode. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsPoolsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsPoolsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// For PostgreSQL database clusters, connection pools can be used to allow adatabase to share its idle connections. The popular PostgreSQL connectionpooling utility PgBouncer is used to provide this service. [See here for more information](https://docs.digitalocean.com/products/databases/postgresql/how-to/manage-connection-pools/)about how and why to use PgBouncer connection pooling includingdetails about the available transaction modes.To add a new connection pool to a PostgreSQL database cluster, send a POSTrequest to `/v2/databases/$DATABASE_ID/pools` specifying a name for the pool,the user to connect with, the database to connect to, as well as its desiredsize and transaction mode. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsPoolsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the connection pools available to a PostgreSQL database cluster, send a GET request to `/v2/databases/$DATABASE_ID/pools`.The result will be a JSON object with a `pools` key. This will be set to an array of connection pool objects. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// For PostgreSQL database clusters, connection pools can be used to allow adatabase to share its idle connections. The popular PostgreSQL connectionpooling utility PgBouncer is used to provide this service. [See here for more information](https://docs.digitalocean.com/products/databases/postgresql/how-to/manage-connection-pools/)about how and why to use PgBouncer connection pooling includingdetails about the available transaction modes.To add a new connection pool to a PostgreSQL database cluster, send a POSTrequest to `/v2/databases/$DATABASE_ID/pools` specifying a name for the pool,the user to connect with, the database to connect to, as well as its desiredsize and transaction mode. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Connection_pool body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PoolsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PoolsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsResponse.cs new file mode 100644 index 0000000..66d7b97 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Pools/PoolsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools +{ + [Obsolete("This class is obsolete. Use PoolsPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PoolsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/Promote/PromoteRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/Promote/PromoteRequestBuilder.cs new file mode 100644 index 0000000..4201cf3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/Promote/PromoteRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.Promote +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\replicas\{replica_name}\promote + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PromoteRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PromoteRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/replicas/{replica_name}/promote", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PromoteRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/replicas/{replica_name}/promote", rawUrl) + { + } + /// + /// To promote a specific read-only replica, send a PUT request to `/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME/promote`.**Note**: Read-only replicas are not supported for Redis clusters.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPutRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To promote a specific read-only replica, send a PUT request to `/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME/promote`.**Note**: Read-only replicas are not supported for Redis clusters.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.Promote.PromoteRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.Promote.PromoteRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PromoteRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameGetResponse.cs new file mode 100644 index 0000000..f533308 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithReplica_nameGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The replica property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_replica? Replica { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_replica Replica { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithReplica_nameGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "replica", n => { Replica = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("replica", Replica); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameItemRequestBuilder.cs new file mode 100644 index 0000000..7ddc21c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameItemRequestBuilder.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.Promote; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\replicas\{replica_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithReplica_nameItemRequestBuilder : BaseRequestBuilder + { + /// The promote property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.Promote.PromoteRequestBuilder Promote + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.Promote.PromoteRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithReplica_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/replicas/{replica_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithReplica_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/replicas/{replica_name}", rawUrl) + { + } + /// + /// To destroy a specific read-only replica, send a DELETE request to `/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME`.**Note**: Read-only replicas are not supported for Redis clusters.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database replica, send a GET request to `/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME`.**Note**: Read-only replicas are not supported for Redis clusters.The response will be a JSON object with a `replica key`. This will be set to an object containing the standard database replica attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithReplica_nameGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithReplica_nameGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database replica, send a GET request to `/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME`.**Note**: Read-only replicas are not supported for Redis clusters.The response will be a JSON object with a `replica key`. This will be set to an object containing the standard database replica attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithReplica_nameGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To destroy a specific read-only replica, send a DELETE request to `/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME`.**Note**: Read-only replicas are not supported for Redis clusters.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing database replica, send a GET request to `/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME`.**Note**: Read-only replicas are not supported for Redis clusters.The response will be a JSON object with a `replica key`. This will be set to an object containing the standard database replica attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithReplica_nameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithReplica_nameItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameResponse.cs new file mode 100644 index 0000000..7c27ea2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/Item/WithReplica_nameResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item +{ + [Obsolete("This class is obsolete. Use WithReplica_nameGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithReplica_nameResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasGetResponse.cs new file mode 100644 index 0000000..bd3cc0b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ReplicasGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The replicas property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Replicas { get; set; } +#nullable restore +#else + public List Replicas { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ReplicasGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "replicas", n => { Replicas = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("replicas", Replicas); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasPostResponse.cs new file mode 100644 index 0000000..0189b09 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ReplicasPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The replica property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_replica? Replica { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_replica Replica { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ReplicasPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "replica", n => { Replica = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("replica", Replica); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasRequestBuilder.cs new file mode 100644 index 0000000..f33a3a7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\replicas + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ReplicasRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.replicas.item collection + /// The name of the database replica. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("replica_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.Item.WithReplica_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ReplicasRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/replicas", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ReplicasRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/replicas", rawUrl) + { + } + /// + /// To list all of the read-only replicas associated with a database cluster, send a GET request to `/v2/databases/$DATABASE_ID/replicas`.**Note**: Read-only replicas are not supported for Redis clusters.The result will be a JSON object with a `replicas` key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsReplicasGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsReplicasGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the read-only replicas associated with a database cluster, send a GET request to `/v2/databases/$DATABASE_ID/replicas`.**Note**: Read-only replicas are not supported for Redis clusters.The result will be a JSON object with a `replicas` key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsReplicasGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to `/v2/databases/$DATABASE_ID/replicas` specifying the name it should be given, the size of the node to be used, and the region where it will be located.**Note**: Read-only replicas are not supported for Redis clusters.The response will be a JSON object with a key called `replica`. The value of this will be an object that contains the standard attributes associated with a database replica. The initial value of the read-only replica's `status` attribute will be `forking`. When the replica is ready to receive traffic, this will transition to `active`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsReplicasPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsReplicasPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to `/v2/databases/$DATABASE_ID/replicas` specifying the name it should be given, the size of the node to be used, and the region where it will be located.**Note**: Read-only replicas are not supported for Redis clusters.The response will be a JSON object with a key called `replica`. The value of this will be an object that contains the standard attributes associated with a database replica. The initial value of the read-only replica's `status` attribute will be `forking`. When the replica is ready to receive traffic, this will transition to `active`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsReplicasPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the read-only replicas associated with a database cluster, send a GET request to `/v2/databases/$DATABASE_ID/replicas`.**Note**: Read-only replicas are not supported for Redis clusters.The result will be a JSON object with a `replicas` key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to `/v2/databases/$DATABASE_ID/replicas` specifying the name it should be given, the size of the node to be used, and the region where it will be located.**Note**: Read-only replicas are not supported for Redis clusters.The response will be a JSON object with a key called `replica`. The value of this will be an object that contains the standard attributes associated with a database replica. The initial value of the read-only replica's `status` attribute will be `forking`. When the replica is ready to receive traffic, this will transition to `active`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_replica body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ReplicasRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ReplicasRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasResponse.cs new file mode 100644 index 0000000..5d0118a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Replicas/ReplicasResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas +{ + [Obsolete("This class is obsolete. Use ReplicasGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ReplicasResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Resize/ResizeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Resize/ResizeRequestBuilder.cs new file mode 100644 index 0000000..b36ea20 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Resize/ResizeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Resize +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\resize + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResizeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ResizeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/resize", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ResizeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/resize", rawUrl) + { + } + /// + /// To resize a database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/resize`. The body of the request must specify both the size and num_nodes attributes.A successful request will receive a 202 Accepted status code with no body in response. Querying the database cluster will show that its status attribute will now be set to resizing. This will transition back to online when the resize operation has completed. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_resize body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_resize body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To resize a database cluster, send a PUT request to `/v2/databases/$DATABASE_ID/resize`. The body of the request must specify both the size and num_nodes attributes.A successful request will receive a 202 Accepted status code with no body in response. Querying the database cluster will show that its status attribute will now be set to resizing. This will transition back to online when the resize operation has completed. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_resize body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster_resize body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Resize.ResizeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Resize.ResizeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResizeRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Sql_mode/Sql_modeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Sql_mode/Sql_modeRequestBuilder.cs new file mode 100644 index 0000000..f2053df --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Sql_mode/Sql_modeRequestBuilder.cs @@ -0,0 +1,167 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Sql_mode +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\sql_mode + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Sql_modeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Sql_modeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/sql_mode", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Sql_modeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/sql_mode", rawUrl) + { + } + /// + /// To retrieve the configured SQL modes for an existing MySQL cluster, send a GET request to `/v2/databases/$DATABASE_ID/sql_mode`.The response will be a JSON object with a `sql_mode` key. This will be set to a string representing the configured SQL modes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Sql_mode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To configure the SQL modes for an existing MySQL cluster, send a PUT request to `/v2/databases/$DATABASE_ID/sql_mode` specifying the desired modes. See the official MySQL 8 documentation for a [full list of supported SQL modes](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sql-mode-full).A successful request will receive a 204 No Content status code with no body in response. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Sql_mode body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Sql_mode body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the configured SQL modes for an existing MySQL cluster, send a GET request to `/v2/databases/$DATABASE_ID/sql_mode`.The response will be a JSON object with a `sql_mode` key. This will be set to a string representing the configured SQL modes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To configure the SQL modes for an existing MySQL cluster, send a PUT request to `/v2/databases/$DATABASE_ID/sql_mode` specifying the desired modes. See the official MySQL 8 documentation for a [full list of supported SQL modes](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sql-mode-full).A successful request will receive a 204 No Content status code with no body in response. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Sql_mode body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Sql_mode body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Sql_mode.Sql_modeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Sql_mode.Sql_modeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Sql_modeRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Sql_modeRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameGetResponse.cs new file mode 100644 index 0000000..bd3c1bc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTopic_nameGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The topic property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose? Topic { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose Topic { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithTopic_nameGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "topic", n => { Topic = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("topic", Topic); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameItemRequestBuilder.cs new file mode 100644 index 0000000..d8f9132 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameItemRequestBuilder.cs @@ -0,0 +1,291 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\topics\{topic_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTopic_nameItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTopic_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/topics/{topic_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTopic_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/topics/{topic_name}", rawUrl) + { + } + /// + /// To delete a single topic within a Kafka cluster, send a DELETE requestto `/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.A status of 204 will be given. This indicates that the request wasprocessed successfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a given topic by name from the set of a Kafka cluster's topics,send a GET request to `/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.The result will be a JSON object with a `topic` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithTopic_nameGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithTopic_nameGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a given topic by name from the set of a Kafka cluster's topics,send a GET request to `/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.The result will be a JSON object with a `topic` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithTopic_nameGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a topic attached to a Kafka cluster, send a PUT request to`/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.The result will be a JSON object with a `topic` key. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithTopic_namePutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithTopic_namePutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_namePutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a topic attached to a Kafka cluster, send a PUT request to`/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.The result will be a JSON object with a `topic` key. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithTopic_namePutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a single topic within a Kafka cluster, send a DELETE requestto `/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.A status of 204 will be given. This indicates that the request wasprocessed successfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To retrieve a given topic by name from the set of a Kafka cluster's topics,send a GET request to `/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.The result will be a JSON object with a `topic` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update a topic attached to a Kafka cluster, send a PUT request to`/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`.The result will be a JSON object with a `topic` key. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_update body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTopic_nameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTopic_nameItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTopic_nameItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_namePutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_namePutResponse.cs new file mode 100644 index 0000000..995a10b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_namePutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTopic_namePutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The topic property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose? Topic { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose Topic { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithTopic_namePutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_namePutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_namePutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "topic", n => { Topic = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("topic", Topic); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameResponse.cs new file mode 100644 index 0000000..3e69308 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/Item/WithTopic_nameResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item +{ + [Obsolete("This class is obsolete. Use WithTopic_nameGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTopic_nameResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsGetResponse.cs new file mode 100644 index 0000000..1076587 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TopicsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The topics property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Topics { get; set; } +#nullable restore +#else + public List Topics { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TopicsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "topics", n => { Topics = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("topics", Topics); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsPostResponse.cs new file mode 100644 index 0000000..803bdc1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TopicsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The topic property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose? Topic { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose Topic { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TopicsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "topic", n => { Topic = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_verbose.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("topic", Topic); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsRequestBuilder.cs new file mode 100644 index 0000000..b123cfb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\topics + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TopicsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.topics.item collection + /// The name used to identify the Kafka topic. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("topic_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.Item.WithTopic_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TopicsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/topics", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TopicsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/topics", rawUrl) + { + } + /// + /// To list all of a Kafka cluster's topics, send a GET request to`/v2/databases/$DATABASE_ID/topics`.The result will be a JSON object with a `topics` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsTopicsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsTopicsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a Kafka cluster's topics, send a GET request to`/v2/databases/$DATABASE_ID/topics`.The result will be a JSON object with a `topics` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsTopicsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a topic attached to a Kafka cluster, send a POST request to`/v2/databases/$DATABASE_ID/topics`.The result will be a JSON object with a `topic` key. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsTopicsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsTopicsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a topic attached to a Kafka cluster, send a POST request to`/v2/databases/$DATABASE_ID/topics`.The result will be a JSON object with a `topic` key. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsTopicsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a Kafka cluster's topics, send a GET request to`/v2/databases/$DATABASE_ID/topics`.The result will be a JSON object with a `topics` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a topic attached to a Kafka cluster, send a POST request to`/v2/databases/$DATABASE_ID/topics`.The result will be a JSON object with a `topic` key. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kafka_topic_create body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TopicsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TopicsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsResponse.cs new file mode 100644 index 0000000..b1acb11 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Topics/TopicsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics +{ + [Obsolete("This class is obsolete. Use TopicsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TopicsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Upgrade/UpgradeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Upgrade/UpgradeRequestBuilder.cs new file mode 100644 index 0000000..42f2620 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Upgrade/UpgradeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Upgrade +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\upgrade + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UpgradeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpgradeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/upgrade", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpgradeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/upgrade", rawUrl) + { + } + /// + /// To upgrade the major version of a database, send a PUT request to `/v2/databases/$DATABASE_ID/upgrade`, specifying the target version.A successful request will receive a 204 No Content status code with no body in response. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Version2 body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Version2 body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To upgrade the major version of a database, send a PUT request to `/v2/databases/$DATABASE_ID/upgrade`, specifying the target version.A successful request will receive a 204 No Content status code with no body in response. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Version2 body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Version2 body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Upgrade.UpgradeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Upgrade.UpgradeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UpgradeRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Database_user.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Database_user.cs new file mode 100644 index 0000000..61c5ad2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Database_user.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class Database_user : global::InfinityFlow.DigitalOcean.Client.Models.Database_user, IParsable + #pragma warning restore CS1591 + { + /// For MongoDB clusters, set to `true` to create a read-only user.This option is not currently supported for other database engines. + public bool? Readonly { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Database_user CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Database_user(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "readonly", n => { Readonly = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteBoolValue("readonly", Readonly); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authPostRequestBody.cs new file mode 100644 index 0000000..4f7f999 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authPostRequestBody.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reset_authPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The mysql_settings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings? MysqlSettings { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings MysqlSettings { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Reset_authPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mysql_settings", n => { MysqlSettings = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Mysql_settings.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mysql_settings", MysqlSettings); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authPostResponse.cs new file mode 100644 index 0000000..9a5be8a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reset_authPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The user property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user? User { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user User { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Reset_authPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "user", n => { User = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_user.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authRequestBuilder.cs new file mode 100644 index 0000000..8dd8152 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authRequestBuilder.cs @@ -0,0 +1,144 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\users\{username}\reset_auth + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reset_authRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Reset_authRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/users/{username}/reset_auth", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Reset_authRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/users/{username}/reset_auth", rawUrl) + { + } + /// + /// To reset the password for a database user, send a POST request to`/v2/databases/$DATABASE_ID/users/$USERNAME/reset_auth`.For `mysql` databases, the authentication method can be specifying byincluding a key in the JSON body called `mysql_settings` with the `auth_plugin`value specified.The response will be a JSON object with a `user` key. This will be set to anobject containing the standard database user attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsReset_authPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsReset_authPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To reset the password for a database user, send a POST request to`/v2/databases/$DATABASE_ID/users/$USERNAME/reset_auth`.For `mysql` databases, the authentication method can be specifying byincluding a key in the JSON body called `mysql_settings` with the `auth_plugin`value specified.The response will be a JSON object with a `user` key. This will be set to anobject containing the standard database user attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsReset_authPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To reset the password for a database user, send a POST request to`/v2/databases/$DATABASE_ID/users/$USERNAME/reset_auth`.For `mysql` databases, the authentication method can be specifying byincluding a key in the JSON body called `mysql_settings` with the `auth_plugin`value specified.The response will be a JSON object with a `user` key. This will be set to anobject containing the standard database user attributes. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reset_authRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authResponse.cs new file mode 100644 index 0000000..0658f36 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/Reset_auth/Reset_authResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth +{ + [Obsolete("This class is obsolete. Use Reset_authPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reset_authResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameGetResponse.cs new file mode 100644 index 0000000..3412bc8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithUsernameGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The user property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user? User { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user User { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithUsernameGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "user", n => { User = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_user.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameItemRequestBuilder.cs new file mode 100644 index 0000000..2551dd0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameItemRequestBuilder.cs @@ -0,0 +1,297 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\users\{username} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithUsernameItemRequestBuilder : BaseRequestBuilder + { + /// The reset_auth property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authRequestBuilder Reset_auth + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.Reset_auth.Reset_authRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithUsernameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/users/{username}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithUsernameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/users/{username}", rawUrl) + { + } + /// + /// To remove a specific database user, send a DELETE request to`/v2/databases/$DATABASE_ID/users/$USERNAME`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed.Note: User management is not supported for Redis clusters. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database user, send a GET request to`/v2/databases/$DATABASE_ID/users/$USERNAME`.Note: User management is not supported for Redis clusters.The response will be a JSON object with a `user` key. This will be set to an objectcontaining the standard database user attributes.For MySQL clusters, additional options will be contained in the `mysql_settings`object.For Kafka clusters, additional options will be contained in the `settings` object. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithUsernameGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithUsernameGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database user, send a GET request to`/v2/databases/$DATABASE_ID/users/$USERNAME`.Note: User management is not supported for Redis clusters.The response will be a JSON object with a `user` key. This will be set to an objectcontaining the standard database user attributes.For MySQL clusters, additional options will be contained in the `mysql_settings`object.For Kafka clusters, additional options will be contained in the `settings` object. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithUsernameGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an existing database user, send a PUT request to `/v2/databases/$DATABASE_ID/users/$USERNAME`with the desired settings.**Note**: only `settings` can be updated via this type of request. If you wish to change the name of a user,you must recreate a new user.The response will be a JSON object with a key called `user`. The value of this will be anobject that contains the name of the update database user, along with the `settings` object thathas been updated. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithUsernamePutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithUsernamePutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an existing database user, send a PUT request to `/v2/databases/$DATABASE_ID/users/$USERNAME`with the desired settings.**Note**: only `settings` can be updated via this type of request. If you wish to change the name of a user,you must recreate a new user.The response will be a JSON object with a key called `user`. The value of this will be anobject that contains the name of the update database user, along with the `settings` object thathas been updated. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithUsernamePutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To remove a specific database user, send a DELETE request to`/v2/databases/$DATABASE_ID/users/$USERNAME`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed.Note: User management is not supported for Redis clusters. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing database user, send a GET request to`/v2/databases/$DATABASE_ID/users/$USERNAME`.Note: User management is not supported for Redis clusters.The response will be a JSON object with a `user` key. This will be set to an objectcontaining the standard database user attributes.For MySQL clusters, additional options will be contained in the `mysql_settings`object.For Kafka clusters, additional options will be contained in the `settings` object. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update an existing database user, send a PUT request to `/v2/databases/$DATABASE_ID/users/$USERNAME`with the desired settings.**Note**: only `settings` can be updated via this type of request. If you wish to change the name of a user,you must recreate a new user.The response will be a JSON object with a key called `user`. The value of this will be anobject that contains the name of the update database user, along with the `settings` object thathas been updated. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithUsernameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithUsernameItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithUsernameItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernamePutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernamePutRequestBody.cs new file mode 100644 index 0000000..777d064 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernamePutRequestBody.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithUsernamePutRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The settings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.User_settings? Settings { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.User_settings Settings { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithUsernamePutRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "settings", n => { Settings = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.User_settings.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("settings", Settings); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernamePutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernamePutResponse.cs new file mode 100644 index 0000000..dd42bff --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernamePutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithUsernamePutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The user property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user? User { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user User { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithUsernamePutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernamePutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "user", n => { User = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_user.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameResponse.cs new file mode 100644 index 0000000..d462f1f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/Item/WithUsernameResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item +{ + [Obsolete("This class is obsolete. Use WithUsernameGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithUsernameResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersGetResponse.cs new file mode 100644 index 0000000..13922d1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class UsersGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The users property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Users { get; set; } +#nullable restore +#else + public List Users { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UsersGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "users", n => { Users = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Database_user.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("users", Users); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersPostRequestBody.cs new file mode 100644 index 0000000..55e6535 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersPostRequestBody.cs @@ -0,0 +1,51 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class UsersPostRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Database_user, IParsable + #pragma warning restore CS1591 + { + /// For MongoDB clusters, set to `true` to create a read-only user.This option is not currently supported for other database engines. + public bool? Readonly { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "readonly", n => { Readonly = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteBoolValue("readonly", Readonly); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersPostResponse.cs new file mode 100644 index 0000000..e543366 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class UsersPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The user property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user? User { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_user User { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UsersPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "user", n => { User = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_user.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersRequestBuilder.cs new file mode 100644 index 0000000..7b10cef --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid}\users + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UsersRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.databases.item.users.item collection + /// The name of the database user. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("username", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.Item.WithUsernameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UsersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/users", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UsersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}/users", rawUrl) + { + } + /// + /// To list all of the users for your database cluster, send a GET request to`/v2/databases/$DATABASE_ID/users`.Note: User management is not supported for Redis clusters.The result will be a JSON object with a `users` key. This will be set to an arrayof database user objects, each of which will contain the standard database user attributes.For MySQL clusters, additional options will be contained in the mysql_settings object. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsUsersGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsUsersGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the users for your database cluster, send a GET request to`/v2/databases/$DATABASE_ID/users`.Note: User management is not supported for Redis clusters.The result will be a JSON object with a `users` key. This will be set to an arrayof database user objects, each of which will contain the standard database user attributes.For MySQL clusters, additional options will be contained in the mysql_settings object. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsUsersGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add a new database user, send a POST request to `/v2/databases/$DATABASE_ID/users`with the desired username.Note: User management is not supported for Redis clusters.When adding a user to a MySQL cluster, additional options can be configured in the`mysql_settings` object.When adding a user to a Kafka cluster, additional options can be configured inthe `settings` object.The response will be a JSON object with a key called `user`. The value of this will be anobject that contains the standard attributes associated with a database user includingits randomly generated password. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsUsersPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsUsersPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add a new database user, send a POST request to `/v2/databases/$DATABASE_ID/users`with the desired username.Note: User management is not supported for Redis clusters.When adding a user to a MySQL cluster, additional options can be configured in the`mysql_settings` object.When adding a user to a Kafka cluster, additional options can be configured inthe `settings` object.The response will be a JSON object with a key called `user`. The value of this will be anobject that contains the standard attributes associated with a database user includingits randomly generated password. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsUsersPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the users for your database cluster, send a GET request to`/v2/databases/$DATABASE_ID/users`.Note: User management is not supported for Redis clusters.The result will be a JSON object with a `users` key. This will be set to an arrayof database user objects, each of which will contain the standard database user attributes.For MySQL clusters, additional options will be contained in the mysql_settings object. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To add a new database user, send a POST request to `/v2/databases/$DATABASE_ID/users`with the desired username.Note: User management is not supported for Redis clusters.When adding a user to a MySQL cluster, additional options can be configured in the`mysql_settings` object.When adding a user to a Kafka cluster, additional options can be configured inthe `settings` object.The response will be a JSON object with a key called `user`. The value of this will be anobject that contains the standard attributes associated with a database user includingits randomly generated password. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UsersRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UsersRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersResponse.cs new file mode 100644 index 0000000..69335e3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/Users/UsersResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users +{ + [Obsolete("This class is obsolete. Use UsersGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class UsersResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuGetResponse.cs new file mode 100644 index 0000000..487ff48 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDatabase_cluster_uuGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster? Database { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster Database { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDatabase_cluster_uuGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "database", n => { Database = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_cluster.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("database", Database); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuItemRequestBuilder.cs new file mode 100644 index 0000000..fc07cb1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuItemRequestBuilder.cs @@ -0,0 +1,308 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Install_update; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Maintenance; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Resize; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Sql_mode; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Upgrade; +using InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item +{ + /// + /// Builds and executes requests for operations under \v2\databases\{database_cluster_uuid} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDatabase_cluster_uuItemRequestBuilder : BaseRequestBuilder + { + /// The ca property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaRequestBuilder Ca + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Ca.CaRequestBuilder(PathParameters, RequestAdapter); + } + /// The config property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigRequestBuilder Config + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Config.ConfigRequestBuilder(PathParameters, RequestAdapter); + } + /// The dbs property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsRequestBuilder Dbs + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Dbs.DbsRequestBuilder(PathParameters, RequestAdapter); + } + /// The events property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsRequestBuilder Events + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Events.EventsRequestBuilder(PathParameters, RequestAdapter); + } + /// The eviction_policy property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyRequestBuilder Eviction_policy + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Eviction_policy.Eviction_policyRequestBuilder(PathParameters, RequestAdapter); + } + /// The firewall property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallRequestBuilder Firewall + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Firewall.FirewallRequestBuilder(PathParameters, RequestAdapter); + } + /// The indexes property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesRequestBuilder Indexes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Indexes.IndexesRequestBuilder(PathParameters, RequestAdapter); + } + /// The install_update property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Install_update.Install_updateRequestBuilder Install_update + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Install_update.Install_updateRequestBuilder(PathParameters, RequestAdapter); + } + /// The logsink property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkRequestBuilder Logsink + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Logsink.LogsinkRequestBuilder(PathParameters, RequestAdapter); + } + /// The maintenance property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Maintenance.MaintenanceRequestBuilder Maintenance + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Maintenance.MaintenanceRequestBuilder(PathParameters, RequestAdapter); + } + /// The migrate property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigrateRequestBuilder Migrate + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Migrate.MigrateRequestBuilder(PathParameters, RequestAdapter); + } + /// The onlineMigration property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.OnlineMigrationRequestBuilder OnlineMigration + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.OnlineMigration.OnlineMigrationRequestBuilder(PathParameters, RequestAdapter); + } + /// The pools property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsRequestBuilder Pools + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Pools.PoolsRequestBuilder(PathParameters, RequestAdapter); + } + /// The replicas property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasRequestBuilder Replicas + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Replicas.ReplicasRequestBuilder(PathParameters, RequestAdapter); + } + /// The resize property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Resize.ResizeRequestBuilder Resize + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Resize.ResizeRequestBuilder(PathParameters, RequestAdapter); + } + /// The sql_mode property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Sql_mode.Sql_modeRequestBuilder Sql_mode + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Sql_mode.Sql_modeRequestBuilder(PathParameters, RequestAdapter); + } + /// The topics property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsRequestBuilder Topics + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Topics.TopicsRequestBuilder(PathParameters, RequestAdapter); + } + /// The upgrade property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Upgrade.UpgradeRequestBuilder Upgrade + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Upgrade.UpgradeRequestBuilder(PathParameters, RequestAdapter); + } + /// The users property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersRequestBuilder Users + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.Users.UsersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDatabase_cluster_uuItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDatabase_cluster_uuItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/{database_cluster_uuid}", rawUrl) + { + } + /// + /// To destroy a specific database, send a DELETE request to `/v2/databases/$DATABASE_ID`.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database cluster, send a GET request to `/v2/databases/$DATABASE_ID`.The response will be a JSON object with a database key. This will be set to an object containing the standard database cluster attributes.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects contain the information needed to connect to the cluster's standby node(s).The embedded maintenance_window object will contain information about any scheduled maintenance for the database cluster. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithDatabase_cluster_uuGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithDatabase_cluster_uuGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing database cluster, send a GET request to `/v2/databases/$DATABASE_ID`.The response will be a JSON object with a database key. This will be set to an object containing the standard database cluster attributes.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects contain the information needed to connect to the cluster's standby node(s).The embedded maintenance_window object will contain information about any scheduled maintenance for the database cluster. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithDatabase_cluster_uuGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To destroy a specific database, send a DELETE request to `/v2/databases/$DATABASE_ID`.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing database cluster, send a GET request to `/v2/databases/$DATABASE_ID`.The response will be a JSON object with a database key. This will be set to an object containing the standard database cluster attributes.The embedded `connection` and `private_connection` objects will contain the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects contain the information needed to connect to the cluster's standby node(s).The embedded maintenance_window object will contain information about any scheduled maintenance for the database cluster. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDatabase_cluster_uuItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDatabase_cluster_uuItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuResponse.cs new file mode 100644 index 0000000..8b709fa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Item/WithDatabase_cluster_uuResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Item +{ + [Obsolete("This class is obsolete. Use WithDatabase_cluster_uuGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDatabase_cluster_uuResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Item.WithDatabase_cluster_uuResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsGetResponse.cs new file mode 100644 index 0000000..75caf40 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CredentialsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The credentials property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials? Credentials { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials Credentials { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CredentialsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "credentials", n => { Credentials = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("credentials", Credentials); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsRequestBuilder.cs new file mode 100644 index 0000000..7c1924a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsRequestBuilder.cs @@ -0,0 +1,197 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials +{ + /// + /// Builds and executes requests for operations under \v2\databases\metrics\credentials + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CredentialsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CredentialsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/metrics/credentials", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CredentialsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/metrics/credentials", rawUrl) + { + } + /// + /// To show the credentials for all database clusters' metrics endpoints, send a GET request to `/v2/databases/metrics/credentials`. The result will be a JSON object with a `credentials` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsCredentialsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsCredentialsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show the credentials for all database clusters' metrics endpoints, send a GET request to `/v2/databases/metrics/credentials`. The result will be a JSON object with a `credentials` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsCredentialsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the credentials for all database clusters' metrics endpoints, send a PUT request to `/v2/databases/metrics/credentials`. A successful request will receive a 204 No Content status code with no body in response. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show the credentials for all database clusters' metrics endpoints, send a GET request to `/v2/databases/metrics/credentials`. The result will be a JSON object with a `credentials` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the credentials for all database clusters' metrics endpoints, send a PUT request to `/v2/databases/metrics/credentials`. A successful request will receive a 204 No Content status code with no body in response. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Database_metrics_credentials body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CredentialsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CredentialsRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsResponse.cs new file mode 100644 index 0000000..f2f51ec --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/Credentials/CredentialsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials +{ + [Obsolete("This class is obsolete. Use CredentialsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CredentialsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/MetricsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/MetricsRequestBuilder.cs new file mode 100644 index 0000000..367bcd8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Metrics/MetricsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics +{ + /// + /// Builds and executes requests for operations under \v2\databases\metrics + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MetricsRequestBuilder : BaseRequestBuilder + { + /// The credentials property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsRequestBuilder Credentials + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Metrics.Credentials.CredentialsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/metrics", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/metrics", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Options/OptionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Options/OptionsRequestBuilder.cs new file mode 100644 index 0000000..d3bbd36 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Databases/Options/OptionsRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Databases.Options +{ + /// + /// Builds and executes requests for operations under \v2\databases\options + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OptionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/options", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/databases/options", rawUrl) + { + } + /// + /// To list all of the options available for the offered database engines, send a GET request to `/v2/databases/options`.The result will be a JSON object with an `options` key. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Options.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the options available for the offered database engines, send a GET request to `/v2/databases/options`.The result will be a JSON object with an `options` key. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.Options.OptionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Databases.Options.OptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OptionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsGetResponse.cs new file mode 100644 index 0000000..c818d22 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DomainsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Array of volumes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Domains { get; set; } +#nullable restore +#else + public List Domains { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DomainsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domains", n => { Domains = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Domain.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("domains", Domains); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsPostResponse.cs new file mode 100644 index 0000000..6428fd6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DomainsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The domain property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain? Domain { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain Domain { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DomainsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain", n => { Domain = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Domain.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("domain", Domain); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsRequestBuilder.cs new file mode 100644 index 0000000..587d0d7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsRequestBuilder.cs @@ -0,0 +1,252 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Domains.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains +{ + /// + /// Builds and executes requests for operations under \v2\domains + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DomainsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.domains.item collection + /// The name of the domain itself. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("domain_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DomainsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DomainsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve a list of all of the domains in your account, send a GET request to `/v2/domains`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDomainsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDomainsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all of the domains in your account, send a GET request to `/v2/domains`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDomainsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new domain, send a POST request to `/v2/domains`. Set the "name"attribute to the domain name you are adding. Optionally, you may set the"ip_address" attribute, and an A record will be automatically created pointingto the apex domain. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsDomainsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsDomainsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new domain, send a POST request to `/v2/domains`. Set the "name"attribute to the domain name you are adding. Optionally, you may set the"ip_address" attribute, and an A record will be automatically created pointingto the apex domain. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsDomainsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all of the domains in your account, send a GET request to `/v2/domains`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new domain, send a POST request to `/v2/domains`. Set the "name"attribute to the domain name you are adding. Optionally, you may set the"ip_address" attribute, and an A record will be automatically created pointingto the apex domain. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Domain body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Domain body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve a list of all of the domains in your account, send a GET request to `/v2/domains`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DomainsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DomainsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DomainsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsResponse.cs new file mode 100644 index 0000000..d45c043 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/DomainsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains +{ + [Obsolete("This class is obsolete. Use DomainsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DomainsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/GetTypeQueryParameterType.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/GetTypeQueryParameterType.cs new file mode 100644 index 0000000..3a7c26d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/GetTypeQueryParameterType.cs @@ -0,0 +1,48 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum GetTypeQueryParameterType + #pragma warning restore CS1591 + { + [EnumMember(Value = "A")] + #pragma warning disable CS1591 + A, + #pragma warning restore CS1591 + [EnumMember(Value = "AAAA")] + #pragma warning disable CS1591 + AAAA, + #pragma warning restore CS1591 + [EnumMember(Value = "CAA")] + #pragma warning disable CS1591 + CAA, + #pragma warning restore CS1591 + [EnumMember(Value = "CNAME")] + #pragma warning disable CS1591 + CNAME, + #pragma warning restore CS1591 + [EnumMember(Value = "MX")] + #pragma warning disable CS1591 + MX, + #pragma warning restore CS1591 + [EnumMember(Value = "NS")] + #pragma warning disable CS1591 + NS, + #pragma warning restore CS1591 + [EnumMember(Value = "SOA")] + #pragma warning disable CS1591 + SOA, + #pragma warning restore CS1591 + [EnumMember(Value = "SRV")] + #pragma warning disable CS1591 + SRV, + #pragma warning restore CS1591 + [EnumMember(Value = "TXT")] + #pragma warning disable CS1591 + TXT, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_GetResponse.cs new file mode 100644 index 0000000..617b098 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDomain_record_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The domain_record property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record? DomainRecord { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record DomainRecord { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDomain_record_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain_record", n => { DomainRecord = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("domain_record", DomainRecord); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_ItemRequestBuilder.cs new file mode 100644 index 0000000..1810fc3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_ItemRequestBuilder.cs @@ -0,0 +1,388 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item +{ + /// + /// Builds and executes requests for operations under \v2\domains\{domain_name}\records\{domain_record_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_record_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDomain_record_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains/{domain_name}/records/{domain_record_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDomain_record_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains/{domain_name}/records/{domain_record_id}", rawUrl) + { + } + /// + /// To delete a record for a domain, send a DELETE request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`.The record will be deleted and the response status will be a 204. Thisindicates a successful request with no body returned. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a specific domain record, send a GET request to `/v2/domains/$DOMAIN_NAME/records/$RECORD_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithDomain_record_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithDomain_record_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a specific domain record, send a GET request to `/v2/domains/$DOMAIN_NAME/records/$RECORD_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithDomain_record_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an existing record, send a PATCH request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`. Any attribute valid forthe record type can be set to a new value for the record.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsWithDomain_record_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsWithDomain_record_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_PatchResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an existing record, send a PATCH request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`. Any attribute valid forthe record type can be set to a new value for the record.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PatchAsWithDomain_record_PatchResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an existing record, send a PUT request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`. Any attribute valid forthe record type can be set to a new value for the record.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithDomain_record_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithDomain_record_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an existing record, send a PUT request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`. Any attribute valid forthe record type can be set to a new value for the record.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithDomain_record_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a record for a domain, send a DELETE request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`.The record will be deleted and the response status will be a 204. Thisindicates a successful request with no body returned. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To retrieve a specific domain record, send a GET request to `/v2/domains/$DOMAIN_NAME/records/$RECORD_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update an existing record, send a PATCH request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`. Any attribute valid forthe record type can be set to a new value for the record.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective attributes. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To update an existing record, send a PUT request to`/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID`. Any attribute valid forthe record type can be set to a new value for the record.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective attributes. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_record_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_record_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_record_ItemRequestBuilderPatchRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_record_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_PatchResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_PatchResponse.cs new file mode 100644 index 0000000..2577470 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_PatchResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDomain_record_PatchResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The domain_record property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record? DomainRecord { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record DomainRecord { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDomain_record_PatchResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_PatchResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_PatchResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain_record", n => { DomainRecord = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("domain_record", DomainRecord); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_PutResponse.cs new file mode 100644 index 0000000..5ce8b0d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDomain_record_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The domain_record property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record? DomainRecord { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record DomainRecord { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDomain_record_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain_record", n => { DomainRecord = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("domain_record", DomainRecord); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_Response.cs new file mode 100644 index 0000000..a255b23 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/Item/WithDomain_record_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item +{ + [Obsolete("This class is obsolete. Use WithDomain_record_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDomain_record_Response : global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsGetResponse.cs new file mode 100644 index 0000000..b75efbd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RecordsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The domain_records property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DomainRecords { get; set; } +#nullable restore +#else + public List DomainRecords { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RecordsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain_records", n => { DomainRecords = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("domain_records", DomainRecords); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsPostResponse.cs new file mode 100644 index 0000000..e68d5fa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RecordsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The domain_record property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record? DomainRecord { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record DomainRecord { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RecordsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain_record", n => { DomainRecord = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Domain_record.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("domain_record", DomainRecord); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsRequestBuilder.cs new file mode 100644 index 0000000..4606cd1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsRequestBuilder.cs @@ -0,0 +1,417 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records +{ + /// + /// Builds and executes requests for operations under \v2\domains\{domain_name}\records + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RecordsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.domains.item.records.item collection + /// The unique identifier of the domain record. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("domain_record_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.domains.item.records.item collection + /// The unique identifier of the domain record. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("domain_record_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.Item.WithDomain_record_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RecordsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains/{domain_name}/records{?name*,page*,per_page*,type*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RecordsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains/{domain_name}/records{?name*,page*,per_page*,type*}", rawUrl) + { + } + /// + /// To get a listing of all records configured for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records`.The list of records returned can be filtered by using the `name` and `type` query parameters. For example, to only include A records for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records?type=A`. `name` must be a fully qualified record name. For example, to only include records matching `sub.example.com`, send a GET request to `/v2/domains/$DOMAIN_NAME/records?name=sub.example.com`. Both name and type may be used together. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsRecordsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsRecordsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get a listing of all records configured for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records`.The list of records returned can be filtered by using the `name` and `type` query parameters. For example, to only include A records for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records?type=A`. `name` must be a fully qualified record name. For example, to only include records matching `sub.example.com`, send a GET request to `/v2/domains/$DOMAIN_NAME/records?name=sub.example.com`. Both name and type may be used together. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsRecordsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new record to a domain, send a POST request to`/v2/domains/$DOMAIN_NAME/records`.The request must include all of the required fields for the domain record typebeing added.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective required attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsRecordsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsRecordsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new record to a domain, send a POST request to`/v2/domains/$DOMAIN_NAME/records`.The request must include all of the required fields for the domain record typebeing added.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective required attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsRecordsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get a listing of all records configured for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records`.The list of records returned can be filtered by using the `name` and `type` query parameters. For example, to only include A records for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records?type=A`. `name` must be a fully qualified record name. For example, to only include records matching `sub.example.com`, send a GET request to `/v2/domains/$DOMAIN_NAME/records?name=sub.example.com`. Both name and type may be used together. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new record to a domain, send a POST request to`/v2/domains/$DOMAIN_NAME/records`.The request must include all of the required fields for the domain record typebeing added.See the [attribute table](#tag/Domain-Records) for details regarding recordtypes and their respective required attributes. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , , , , , , , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RecordsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_a? DomainRecordA { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_a DomainRecordA { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_aaaa? DomainRecordAaaa { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_aaaa DomainRecordAaaa { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_caa? DomainRecordCaa { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_caa DomainRecordCaa { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_cname? DomainRecordCname { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_cname DomainRecordCname { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_mx? DomainRecordMx { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_mx DomainRecordMx { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_ns? DomainRecordNs { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_ns DomainRecordNs { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_soa? DomainRecordSoa { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_soa DomainRecordSoa { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_srv? DomainRecordSrv { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_srv DomainRecordSrv { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_txt? DomainRecordTxt { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_txt DomainRecordTxt { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder.RecordsPostRequestBody(); + result.DomainRecordA = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_a(); + result.DomainRecordAaaa = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_aaaa(); + result.DomainRecordCaa = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_caa(); + result.DomainRecordCname = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_cname(); + result.DomainRecordMx = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_mx(); + result.DomainRecordNs = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_ns(); + result.DomainRecordSoa = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_soa(); + result.DomainRecordSrv = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_srv(); + result.DomainRecordTxt = new global::InfinityFlow.DigitalOcean.Client.Models.Domain_record_txt(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(DomainRecordA != null || DomainRecordAaaa != null || DomainRecordCaa != null || DomainRecordCname != null || DomainRecordMx != null || DomainRecordNs != null || DomainRecordSoa != null || DomainRecordSrv != null || DomainRecordTxt != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(DomainRecordA, DomainRecordAaaa, DomainRecordCaa, DomainRecordCname, DomainRecordMx, DomainRecordNs, DomainRecordSoa, DomainRecordSrv, DomainRecordTxt); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, DomainRecordA, DomainRecordAaaa, DomainRecordCaa, DomainRecordCname, DomainRecordMx, DomainRecordNs, DomainRecordSoa, DomainRecordSrv, DomainRecordTxt); + } + } + /// + /// To get a listing of all records configured for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records`.The list of records returned can be filtered by using the `name` and `type` query parameters. For example, to only include A records for a domain, send a GET request to `/v2/domains/$DOMAIN_NAME/records?type=A`. `name` must be a fully qualified record name. For example, to only include records matching `sub.example.com`, send a GET request to `/v2/domains/$DOMAIN_NAME/records?name=sub.example.com`. Both name and type may be used together. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RecordsRequestBuilderGetQueryParameters + { + /// A fully qualified record name. For example, to only include records matching sub.example.com, send a GET request to `/v2/domains/$DOMAIN_NAME/records?name=sub.example.com`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// The type of the DNS record. For example: A, CNAME, TXT, ... + [Obsolete("This property is deprecated, use TypeAsGetTypeQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + /// The type of the DNS record. For example: A, CNAME, TXT, ... + [QueryParameter("type")] + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.GetTypeQueryParameterType? TypeAsGetTypeQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RecordsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RecordsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsResponse.cs new file mode 100644 index 0000000..219b3d3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/Records/RecordsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records +{ + [Obsolete("This class is obsolete. Use RecordsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RecordsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameGetResponse.cs new file mode 100644 index 0000000..bc4ad0c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDomain_nameGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The domain property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Domain? Domain { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Domain Domain { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDomain_nameGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "domain", n => { Domain = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Domain.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("domain", Domain); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameItemRequestBuilder.cs new file mode 100644 index 0000000..cffa9f6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameItemRequestBuilder.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item +{ + /// + /// Builds and executes requests for operations under \v2\domains\{domain_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_nameItemRequestBuilder : BaseRequestBuilder + { + /// The records property + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder Records + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.Records.RecordsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDomain_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains/{domain_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDomain_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/domains/{domain_name}", rawUrl) + { + } + /// + /// To delete a domain, send a DELETE request to `/v2/domains/$DOMAIN_NAME`. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get details about a specific domain, send a GET request to `/v2/domains/$DOMAIN_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithDomain_nameGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithDomain_nameGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get details about a specific domain, send a GET request to `/v2/domains/$DOMAIN_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithDomain_nameGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a domain, send a DELETE request to `/v2/domains/$DOMAIN_NAME`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To get details about a specific domain, send a GET request to `/v2/domains/$DOMAIN_NAME`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_nameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDomain_nameItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameResponse.cs new file mode 100644 index 0000000..757511d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Domains/Item/WithDomain_nameResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Domains.Item +{ + [Obsolete("This class is obsolete. Use WithDomain_nameGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDomain_nameResponse : global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Domains.Item.WithDomain_nameResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsPostResponse.cs new file mode 100644 index 0000000..662d410 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ActionsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..35e5d64 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,232 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions +{ + /// + /// Builds and executes requests for operations under \v2\droplets\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/actions{?tag_name*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/actions{?tag_name*}", rawUrl) + { + } + /// + /// Some actions can be performed in bulk on tagged Droplets. The actions can beinitiated by sending a POST to `/v2/droplets/actions?tag_name=$TAG_NAME` withthe action arguments.Only a sub-set of action types are supported:- `power_cycle`- `power_on`- `power_off`- `shutdown`- `enable_ipv6`- `enable_backups`- `disable_backups`- `snapshot` + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Some actions can be performed in bulk on tagged Droplets. The actions can beinitiated by sending a POST to `/v2/droplets/actions?tag_name=$TAG_NAME` withthe action arguments.Only a sub-set of action types are supported:- `power_cycle`- `power_on`- `power_off`- `shutdown`- `enable_ipv6`- `enable_backups`- `disable_backups`- `snapshot` + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsActionsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Some actions can be performed in bulk on tagged Droplets. The actions can beinitiated by sending a POST to `/v2/droplets/actions?tag_name=$TAG_NAME` withthe action arguments.Only a sub-set of action types are supported:- `power_cycle`- `power_on`- `power_off`- `shutdown`- `enable_ipv6`- `enable_backups`- `disable_backups`- `snapshot` + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action? DropletAction { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action DropletAction { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot? DropletActionSnapshot { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot DropletActionSnapshot { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder.ActionsPostRequestBody(); + if("disable_backups".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletAction = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action(); + } + else if("snapshot".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletActionSnapshot = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(DropletAction != null) + { + return DropletAction.GetFieldDeserializers(); + } + else if(DropletActionSnapshot != null) + { + return DropletActionSnapshot.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(DropletAction != null) + { + writer.WriteObjectValue(null, DropletAction); + } + else if(DropletActionSnapshot != null) + { + writer.WriteObjectValue(null, DropletActionSnapshot); + } + } + } + /// + /// Some actions can be performed in bulk on tagged Droplets. The actions can beinitiated by sending a POST to `/v2/droplets/actions?tag_name=$TAG_NAME` withthe action arguments.Only a sub-set of action types are supported:- `power_cycle`- `power_on`- `power_off`- `shutdown`- `enable_ipv6`- `enable_backups`- `disable_backups`- `snapshot` + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostQueryParameters + { + /// Used to filter Droplets by a specific tag. Can not be combined with `name` or `type`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag_name")] + public string? TagName { get; set; } +#nullable restore +#else + [QueryParameter("tag_name")] + public string TagName { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsResponse.cs new file mode 100644 index 0000000..a067c62 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions +{ + [Obsolete("This class is obsolete. Use ActionsPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsGetResponse.cs new file mode 100644 index 0000000..a50943f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplets property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Droplets { get; set; } +#nullable restore +#else + public List Droplets { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DropletsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplets", n => { Droplets = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Droplet.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("droplets", Droplets); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember1.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember1.cs new file mode 100644 index 0000000..77af378 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember1.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsPostResponseMember1 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplet property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet? Droplet { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet Droplet { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1_links Links { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DropletsPostResponseMember1() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet", n => { Droplet = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1_links.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("droplet", Droplet); + writer.WriteObjectValue("links", Links); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember1_links.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember1_links.cs new file mode 100644 index 0000000..b794446 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember1_links.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsPostResponseMember1_links : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public DropletsPostResponseMember1_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Action_link.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember2.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember2.cs new file mode 100644 index 0000000..624cbe6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember2.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsPostResponseMember2 : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplets property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Droplets { get; set; } +#nullable restore +#else + public List Droplets { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2_links Links { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DropletsPostResponseMember2() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2 CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplets", n => { Droplets = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Droplet.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2_links.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("droplets", Droplets); + writer.WriteObjectValue("links", Links); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember2_links.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember2_links.cs new file mode 100644 index 0000000..990bba4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsPostResponseMember2_links.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsPostResponseMember2_links : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public DropletsPostResponseMember2_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Action_link.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsRequestBuilder.cs new file mode 100644 index 0000000..0263836 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsRequestBuilder.cs @@ -0,0 +1,604 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + /// + /// Builds and executes requests for operations under \v2\droplets + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilder : BaseRequestBuilder + { + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.droplets.item collection + /// A unique identifier for a Droplet instance. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("droplet_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.droplets.item collection + /// A unique identifier for a Droplet instance. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("droplet_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DropletsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets{?name*,page*,per_page*,tag_name*,type*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DropletsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets{?name*,page*,per_page*,tag_name*,type*}", rawUrl) + { + } + /// + /// To delete **all** Droplets assigned to a specific tag, include the `tag_name`query parameter set to the name of the tag in your DELETE request. Forexample, `/v2/droplets?tag_name=$TAG_NAME`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all Droplets in your account, send a GET request to `/v2/droplets`.The response body will be a JSON object with a key of `droplets`. This will beset to an array containing objects each representing a Droplet. These willcontain the standard Droplet attributes.### Filtering Results by TagIt's possible to request filtered results by including certain query parameters.To only list Droplets assigned to a specific tag, include the `tag_name` queryparameter set to the name of the tag in your GET request. For example,`/v2/droplets?tag_name=$TAG_NAME`.### GPU DropletsBy default, only non-GPU Droplets are returned. To list only GPU Droplets, setthe `type` query parameter to `gpus`. For example, `/v2/droplets?type=gpus`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDropletsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDropletsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all Droplets in your account, send a GET request to `/v2/droplets`.The response body will be a JSON object with a key of `droplets`. This will beset to an array containing objects each representing a Droplet. These willcontain the standard Droplet attributes.### Filtering Results by TagIt's possible to request filtered results by including certain query parameters.To only list Droplets assigned to a specific tag, include the `tag_name` queryparameter set to the name of the tag in your GET request. For example,`/v2/droplets?tag_name=$TAG_NAME`.### GPU DropletsBy default, only non-GPU Droplets are returned. To list only GPU Droplets, setthe `type` query parameter to `gpus`. For example, `/v2/droplets?type=gpus`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDropletsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new Droplet, send a POST request to `/v2/droplets` setting therequired attributes.A Droplet will be created using the provided information. The response bodywill contain a JSON object with a key called `droplet`. The value will be anobject containing the standard attributes for your new Droplet. The responsecode, 202 Accepted, does not indicate the success or failure of the operation,just that the request has been accepted for processing. The `actions` returnedas part of the response's `links` object can be used to check the statusof the Droplet create event.### Create Multiple DropletsCreating multiple Droplets is very similar to creating a single Droplet.Instead of sending `name` as a string, send `names` as an array of strings. ADroplet will be created for each name you send using the associatedinformation. Up to ten Droplets may be created this way at a time.Rather than returning a single Droplet, the response body will contain a JSONarray with a key called `droplets`. This will be set to an array of JSONobjects, each of which will contain the standard Droplet attributes. Theresponse code, 202 Accepted, does not indicate the success or failure of anyoperation, just that the request has been accepted for processing. The arrayof `actions` returned as part of the response's `links` object can be used tocheck the status of each individual Droplet create event. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsDropletsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsDropletsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new Droplet, send a POST request to `/v2/droplets` setting therequired attributes.A Droplet will be created using the provided information. The response bodywill contain a JSON object with a key called `droplet`. The value will be anobject containing the standard attributes for your new Droplet. The responsecode, 202 Accepted, does not indicate the success or failure of the operation,just that the request has been accepted for processing. The `actions` returnedas part of the response's `links` object can be used to check the statusof the Droplet create event.### Create Multiple DropletsCreating multiple Droplets is very similar to creating a single Droplet.Instead of sending `name` as a string, send `names` as an array of strings. ADroplet will be created for each name you send using the associatedinformation. Up to ten Droplets may be created this way at a time.Rather than returning a single Droplet, the response body will contain a JSONarray with a key called `droplets`. This will be set to an array of JSONobjects, each of which will contain the standard Droplet attributes. Theresponse code, 202 Accepted, does not indicate the success or failure of anyoperation, just that the request has been accepted for processing. The arrayof `actions` returned as part of the response's `links` object can be used tocheck the status of each individual Droplet create event. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsDropletsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete **all** Droplets assigned to a specific tag, include the `tag_name`query parameter set to the name of the tag in your DELETE request. Forexample, `/v2/droplets?tag_name=$TAG_NAME`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, "{+baseurl}/v2/droplets?tag_name={tag_name}", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To list all Droplets in your account, send a GET request to `/v2/droplets`.The response body will be a JSON object with a key of `droplets`. This will beset to an array containing objects each representing a Droplet. These willcontain the standard Droplet attributes.### Filtering Results by TagIt's possible to request filtered results by including certain query parameters.To only list Droplets assigned to a specific tag, include the `tag_name` queryparameter set to the name of the tag in your GET request. For example,`/v2/droplets?tag_name=$TAG_NAME`.### GPU DropletsBy default, only non-GPU Droplets are returned. To list only GPU Droplets, setthe `type` query parameter to `gpus`. For example, `/v2/droplets?type=gpus`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new Droplet, send a POST request to `/v2/droplets` setting therequired attributes.A Droplet will be created using the provided information. The response bodywill contain a JSON object with a key called `droplet`. The value will be anobject containing the standard attributes for your new Droplet. The responsecode, 202 Accepted, does not indicate the success or failure of the operation,just that the request has been accepted for processing. The `actions` returnedas part of the response's `links` object can be used to check the statusof the Droplet create event.### Create Multiple DropletsCreating multiple Droplets is very similar to creating a single Droplet.Instead of sending `name` as a string, send `names` as an array of strings. ADroplet will be created for each name you send using the associatedinformation. Up to ten Droplets may be created this way at a time.Rather than returning a single Droplet, the response body will contain a JSONarray with a key called `droplets`. This will be set to an array of JSONobjects, each of which will contain the standard Droplet attributes. Theresponse code, 202 Accepted, does not indicate the success or failure of anyoperation, just that the request has been accepted for processing. The arrayof `actions` returned as part of the response's `links` object can be used tocheck the status of each individual Droplet create event. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/v2/droplets", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_multi_create? DropletMultiCreate { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_multi_create DropletMultiCreate { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_single_create? DropletSingleCreate { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_single_create DropletSingleCreate { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostRequestBody(); + if("droplet_multi_create".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletMultiCreate = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_multi_create(); + } + else if("droplet_single_create".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletSingleCreate = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_single_create(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(DropletMultiCreate != null) + { + return DropletMultiCreate.GetFieldDeserializers(); + } + else if(DropletSingleCreate != null) + { + return DropletSingleCreate.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(DropletMultiCreate != null) + { + writer.WriteObjectValue(null, DropletMultiCreate); + } + else if(DropletSingleCreate != null) + { + writer.WriteObjectValue(null, DropletSingleCreate); + } + } + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsPostResponse : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1? DropletsPostResponseMember1 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1 DropletsPostResponseMember1 { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2? DropletsPostResponseMember2 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2 DropletsPostResponseMember2 { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsPostResponse(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletsPostResponseMember1 = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1(); + } + else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletsPostResponseMember2 = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(DropletsPostResponseMember1 != null) + { + return DropletsPostResponseMember1.GetFieldDeserializers(); + } + else if(DropletsPostResponseMember2 != null) + { + return DropletsPostResponseMember2.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(DropletsPostResponseMember1 != null) + { + writer.WriteObjectValue(null, DropletsPostResponseMember1); + } + else if(DropletsPostResponseMember2 != null) + { + writer.WriteObjectValue(null, DropletsPostResponseMember2); + } + } + } + /// + /// To delete **all** Droplets assigned to a specific tag, include the `tag_name`query parameter set to the name of the tag in your DELETE request. Forexample, `/v2/droplets?tag_name=$TAG_NAME`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderDeleteQueryParameters + { + /// Specifies Droplets to be deleted by tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag_name")] + public string? TagName { get; set; } +#nullable restore +#else + [QueryParameter("tag_name")] + public string TagName { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// To list all Droplets in your account, send a GET request to `/v2/droplets`.The response body will be a JSON object with a key of `droplets`. This will beset to an array containing objects each representing a Droplet. These willcontain the standard Droplet attributes.### Filtering Results by TagIt's possible to request filtered results by including certain query parameters.To only list Droplets assigned to a specific tag, include the `tag_name` queryparameter set to the name of the tag in your GET request. For example,`/v2/droplets?tag_name=$TAG_NAME`.### GPU DropletsBy default, only non-GPU Droplets are returned. To list only GPU Droplets, setthe `type` query parameter to `gpus`. For example, `/v2/droplets?type=gpus`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderGetQueryParameters + { + /// Used to filter list response by Droplet name returning only exact matches. It is case-insensitive and can not be combined with `tag_name`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// Used to filter Droplets by a specific tag. Can not be combined with `name` or `type`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag_name")] + public string? TagName { get; set; } +#nullable restore +#else + [QueryParameter("tag_name")] + public string TagName { get; set; } +#endif + /// When `type` is set to `gpus`, only GPU Droplets will be returned. By default, only non-GPU Droplets are returned. Can not be combined with `tag_name`. + [Obsolete("This property is deprecated, use TypeAsGetTypeQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + /// When `type` is set to `gpus`, only GPU Droplets will be returned. By default, only non-GPU Droplets are returned. Can not be combined with `tag_name`. + [QueryParameter("type")] + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.GetTypeQueryParameterType? TypeAsGetTypeQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsResponse : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1? DropletsPostResponseMember1 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1 DropletsPostResponseMember1 { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2? DropletsPostResponseMember2 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2 DropletsPostResponseMember2 { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder.DropletsResponse(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletsPostResponseMember1 = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember1(); + } + else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.DropletsPostResponseMember2 = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsPostResponseMember2(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(DropletsPostResponseMember1 != null) + { + return DropletsPostResponseMember1.GetFieldDeserializers(); + } + else if(DropletsPostResponseMember2 != null) + { + return DropletsPostResponseMember2.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(DropletsPostResponseMember1 != null) + { + writer.WriteObjectValue(null, DropletsPostResponseMember1); + } + else if(DropletsPostResponseMember2 != null) + { + writer.WriteObjectValue(null, DropletsPostResponseMember2); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsResponse.cs new file mode 100644 index 0000000..27e3908 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/DropletsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + [Obsolete("This class is obsolete. Use DropletsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/GetTypeQueryParameterType.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/GetTypeQueryParameterType.cs new file mode 100644 index 0000000..cba4df5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/GetTypeQueryParameterType.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum GetTypeQueryParameterType + #pragma warning restore CS1591 + { + [EnumMember(Value = "droplets")] + #pragma warning disable CS1591 + Droplets, + #pragma warning restore CS1591 + [EnumMember(Value = "gpus")] + #pragma warning disable CS1591 + Gpus, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsGetResponse.cs new file mode 100644 index 0000000..02be196 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ActionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsPostResponse.cs new file mode 100644 index 0000000..487a55b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.ActionObject? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.ActionObject Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ActionsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..36446a8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,393 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.droplets.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.droplets.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/actions{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/actions{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve a list of all actions that have been executed for a Droplet, senda GET request to `/v2/droplets/$DROPLET_ID/actions`.The results will be returned as a JSON object with an `actions` key. This willbe set to an array filled with `action` objects containing the standard`action` attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsActionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsActionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all actions that have been executed for a Droplet, senda GET request to `/v2/droplets/$DROPLET_ID/actions`.The results will be returned as a JSON object with an `actions` key. This willbe set to an array filled with `action` objects containing the standard`action` attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsActionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a Droplet send a POST request to`/v2/droplets/$DROPLET_ID/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details || ---------------------------------------- | ----------- || <nobr>`enable_backups`</nobr> | Enables backups for a Droplet || <nobr>`disable_backups`</nobr> | Disables backups for a Droplet || <nobr>`change_backup_policy`</nobr> | Update the backup policy for a Droplet || <nobr>`reboot`</nobr> | Reboots a Droplet. A `reboot` action is an attempt to reboot the Droplet in a graceful way, similar to using the `reboot` command from the console. || <nobr>`power_cycle`</nobr> | Power cycles a Droplet. A `powercycle` action is similar to pushing the reset button on a physical machine, it's similar to booting from scratch. || <nobr>`shutdown`</nobr> | Shutsdown a Droplet. A shutdown action is an attempt to shutdown the Droplet in a graceful way, similar to using the `shutdown` command from the console. Since a `shutdown` command can fail, this action guarantees that the command is issued, not that it succeeds. The preferred way to turn off a Droplet is to attempt a shutdown, with a reasonable timeout, followed by a `power_off` action to ensure the Droplet is off. || <nobr>`power_off`</nobr> | Powers off a Droplet. A `power_off` event is a hard shutdown and should only be used if the `shutdown` action is not successful. It is similar to cutting the power on a server and could lead to complications. || <nobr>`power_on`</nobr> | Powers on a Droplet. || <nobr>`restore`</nobr> | Restore a Droplet using a backup image. The image ID that is passed in must be a backup of the current Droplet instance. The operation will leave any embedded SSH keys intact. || <nobr>`password_reset`</nobr> | Resets the root password for a Droplet. A new password will be provided via email. It must be changed after first use. || <nobr>`resize`</nobr> | Resizes a Droplet. Set the `size` attribute to a size slug. If a permanent resize with disk changes included is desired, set the `disk` attribute to `true`. || <nobr>`rebuild`</nobr> | Rebuilds a Droplet from a new base image. Set the `image` attribute to an image ID or slug. || <nobr>`rename`</nobr> | Renames a Droplet. || <nobr>`change_kernel`</nobr> | Changes a Droplet's kernel. Only applies to Droplets with externally managed kernels. All Droplets created after March 2017 use internal kernels by default. || <nobr>`enable_ipv6`</nobr> | Enables IPv6 for a Droplet. Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets) is required. || <nobr>`snapshot`</nobr> | Takes a snapshot of a Droplet. | + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a Droplet send a POST request to`/v2/droplets/$DROPLET_ID/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details || ---------------------------------------- | ----------- || <nobr>`enable_backups`</nobr> | Enables backups for a Droplet || <nobr>`disable_backups`</nobr> | Disables backups for a Droplet || <nobr>`change_backup_policy`</nobr> | Update the backup policy for a Droplet || <nobr>`reboot`</nobr> | Reboots a Droplet. A `reboot` action is an attempt to reboot the Droplet in a graceful way, similar to using the `reboot` command from the console. || <nobr>`power_cycle`</nobr> | Power cycles a Droplet. A `powercycle` action is similar to pushing the reset button on a physical machine, it's similar to booting from scratch. || <nobr>`shutdown`</nobr> | Shutsdown a Droplet. A shutdown action is an attempt to shutdown the Droplet in a graceful way, similar to using the `shutdown` command from the console. Since a `shutdown` command can fail, this action guarantees that the command is issued, not that it succeeds. The preferred way to turn off a Droplet is to attempt a shutdown, with a reasonable timeout, followed by a `power_off` action to ensure the Droplet is off. || <nobr>`power_off`</nobr> | Powers off a Droplet. A `power_off` event is a hard shutdown and should only be used if the `shutdown` action is not successful. It is similar to cutting the power on a server and could lead to complications. || <nobr>`power_on`</nobr> | Powers on a Droplet. || <nobr>`restore`</nobr> | Restore a Droplet using a backup image. The image ID that is passed in must be a backup of the current Droplet instance. The operation will leave any embedded SSH keys intact. || <nobr>`password_reset`</nobr> | Resets the root password for a Droplet. A new password will be provided via email. It must be changed after first use. || <nobr>`resize`</nobr> | Resizes a Droplet. Set the `size` attribute to a size slug. If a permanent resize with disk changes included is desired, set the `disk` attribute to `true`. || <nobr>`rebuild`</nobr> | Rebuilds a Droplet from a new base image. Set the `image` attribute to an image ID or slug. || <nobr>`rename`</nobr> | Renames a Droplet. || <nobr>`change_kernel`</nobr> | Changes a Droplet's kernel. Only applies to Droplets with externally managed kernels. All Droplets created after March 2017 use internal kernels by default. || <nobr>`enable_ipv6`</nobr> | Enables IPv6 for a Droplet. Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets) is required. || <nobr>`snapshot`</nobr> | Takes a snapshot of a Droplet. | + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsActionsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all actions that have been executed for a Droplet, senda GET request to `/v2/droplets/$DROPLET_ID/actions`.The results will be returned as a JSON object with an `actions` key. This willbe set to an array filled with `action` objects containing the standard`action` attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To initiate an action on a Droplet send a POST request to`/v2/droplets/$DROPLET_ID/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details || ---------------------------------------- | ----------- || <nobr>`enable_backups`</nobr> | Enables backups for a Droplet || <nobr>`disable_backups`</nobr> | Disables backups for a Droplet || <nobr>`change_backup_policy`</nobr> | Update the backup policy for a Droplet || <nobr>`reboot`</nobr> | Reboots a Droplet. A `reboot` action is an attempt to reboot the Droplet in a graceful way, similar to using the `reboot` command from the console. || <nobr>`power_cycle`</nobr> | Power cycles a Droplet. A `powercycle` action is similar to pushing the reset button on a physical machine, it's similar to booting from scratch. || <nobr>`shutdown`</nobr> | Shutsdown a Droplet. A shutdown action is an attempt to shutdown the Droplet in a graceful way, similar to using the `shutdown` command from the console. Since a `shutdown` command can fail, this action guarantees that the command is issued, not that it succeeds. The preferred way to turn off a Droplet is to attempt a shutdown, with a reasonable timeout, followed by a `power_off` action to ensure the Droplet is off. || <nobr>`power_off`</nobr> | Powers off a Droplet. A `power_off` event is a hard shutdown and should only be used if the `shutdown` action is not successful. It is similar to cutting the power on a server and could lead to complications. || <nobr>`power_on`</nobr> | Powers on a Droplet. || <nobr>`restore`</nobr> | Restore a Droplet using a backup image. The image ID that is passed in must be a backup of the current Droplet instance. The operation will leave any embedded SSH keys intact. || <nobr>`password_reset`</nobr> | Resets the root password for a Droplet. A new password will be provided via email. It must be changed after first use. || <nobr>`resize`</nobr> | Resizes a Droplet. Set the `size` attribute to a size slug. If a permanent resize with disk changes included is desired, set the `disk` attribute to `true`. || <nobr>`rebuild`</nobr> | Rebuilds a Droplet from a new base image. Set the `image` attribute to an image ID or slug. || <nobr>`rename`</nobr> | Renames a Droplet. || <nobr>`change_kernel`</nobr> | Changes a Droplet's kernel. Only applies to Droplets with externally managed kernels. All Droplets created after March 2017 use internal kernels by default. || <nobr>`enable_ipv6`</nobr> | Enables IPv6 for a Droplet. Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets) is required. || <nobr>`snapshot`</nobr> | Takes a snapshot of a Droplet. | + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , , , , , , , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action? DropletAction { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action DropletAction { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_backup_policy? DropletActionChangeBackupPolicy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_backup_policy DropletActionChangeBackupPolicy { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_kernel? DropletActionChangeKernel { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_kernel DropletActionChangeKernel { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_enable_backups? DropletActionEnableBackups { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_enable_backups DropletActionEnableBackups { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild? DropletActionRebuild { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild DropletActionRebuild { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rename? DropletActionRename { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rename DropletActionRename { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_resize? DropletActionResize { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_resize DropletActionResize { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_restore? DropletActionRestore { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_restore DropletActionRestore { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot? DropletActionSnapshot { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot DropletActionSnapshot { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody(); + result.DropletAction = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action(); + result.DropletActionChangeBackupPolicy = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_backup_policy(); + result.DropletActionChangeKernel = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_change_kernel(); + result.DropletActionEnableBackups = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_enable_backups(); + result.DropletActionRebuild = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rebuild(); + result.DropletActionRename = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_rename(); + result.DropletActionResize = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_resize(); + result.DropletActionRestore = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_restore(); + result.DropletActionSnapshot = new global::InfinityFlow.DigitalOcean.Client.Models.Droplet_action_snapshot(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(DropletAction != null || DropletActionChangeBackupPolicy != null || DropletActionChangeKernel != null || DropletActionEnableBackups != null || DropletActionRebuild != null || DropletActionRename != null || DropletActionResize != null || DropletActionRestore != null || DropletActionSnapshot != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(DropletAction, DropletActionChangeBackupPolicy, DropletActionChangeKernel, DropletActionEnableBackups, DropletActionRebuild, DropletActionRename, DropletActionResize, DropletActionRestore, DropletActionSnapshot); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, DropletAction, DropletActionChangeBackupPolicy, DropletActionChangeKernel, DropletActionEnableBackups, DropletActionRebuild, DropletActionRename, DropletActionResize, DropletActionRestore, DropletActionSnapshot); + } + } + /// + /// To retrieve a list of all actions that have been executed for a Droplet, senda GET request to `/v2/droplets/$DROPLET_ID/actions`.The results will be returned as a JSON object with an `actions` key. This willbe set to an array filled with `action` objects containing the standard`action` attributes. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsResponse.cs new file mode 100644 index 0000000..47b416e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions +{ + [Obsolete("This class is obsolete. Use ActionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_GetResponse.cs new file mode 100644 index 0000000..f7e5430 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.ActionObject? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.ActionObject Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithAction_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_ItemRequestBuilder.cs new file mode 100644 index 0000000..21a54fa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_ItemRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\actions\{action_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/actions/{action_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/actions/{action_id}", rawUrl) + { + } + /// + /// To retrieve a Droplet action, send a GET request to`/v2/droplets/$DROPLET_ID/actions/$ACTION_ID`.The response will be a JSON object with a key called `action`. The value willbe a Droplet action object. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithAction_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithAction_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a Droplet action, send a GET request to`/v2/droplets/$DROPLET_ID/actions/$ACTION_ID`.The response will be a JSON object with a key called `action`. The value willbe a Droplet action object. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithAction_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a Droplet action, send a GET request to`/v2/droplets/$DROPLET_ID/actions/$ACTION_ID`.The response will be a JSON object with a key called `action`. The value willbe a Droplet action object. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_Response.cs new file mode 100644 index 0000000..c834f32 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Actions/Item/WithAction_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item +{ + [Obsolete("This class is obsolete. Use WithAction_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_Response : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.Item.WithAction_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Dangerous/DangerousRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Dangerous/DangerousRequestBuilder.cs new file mode 100644 index 0000000..c41fa63 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Dangerous/DangerousRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Dangerous +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\destroy_with_associated_resources\dangerous + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DangerousRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DangerousRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/dangerous", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DangerousRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/dangerous", rawUrl) + { + } + /// + /// To destroy a Droplet along with all of its associated resources, send a DELETErequest to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous`endpoint. The headers of this request must include an `X-Dangerous` key set to`true`. To preview which resources will be destroyed, first query theDroplet's associated resources. This operation _can not_ be reverse and shouldbe used with caution.A successful response will include a 202 response code and no content. Use thestatus endpoint to check on the success or failure of the destruction of theindividual resources. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To destroy a Droplet along with all of its associated resources, send a DELETErequest to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous`endpoint. The headers of this request must include an `X-Dangerous` key set to`true`. To preview which resources will be destroyed, first query theDroplet's associated resources. This operation _can not_ be reverse and shouldbe used with caution.A successful response will include a 202 response code and no content. Use thestatus endpoint to check on the success or failure of the destruction of theindividual resources. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DangerousRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesGetResponse.cs new file mode 100644 index 0000000..6aff640 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesGetResponse.cs @@ -0,0 +1,106 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Destroy_with_associated_resourcesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The floating_ips property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FloatingIps { get; set; } +#nullable restore +#else + public List FloatingIps { get; set; } +#endif + /// The reserved_ips property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ReservedIps { get; set; } +#nullable restore +#else + public List ReservedIps { get; set; } +#endif + /// The snapshots property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Snapshots { get; set; } +#nullable restore +#else + public List Snapshots { get; set; } +#endif + /// The volumes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Volumes { get; set; } +#nullable restore +#else + public List Volumes { get; set; } +#endif + /// The volume_snapshots property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VolumeSnapshots { get; set; } +#nullable restore +#else + public List VolumeSnapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Destroy_with_associated_resourcesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "floating_ips", n => { FloatingIps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "reserved_ips", n => { ReservedIps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "snapshots", n => { Snapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "volume_snapshots", n => { VolumeSnapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + { "volumes", n => { Volumes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("floating_ips", FloatingIps); + writer.WriteCollectionOfObjectValues("reserved_ips", ReservedIps); + writer.WriteCollectionOfObjectValues("snapshots", Snapshots); + writer.WriteCollectionOfObjectValues("volume_snapshots", VolumeSnapshots); + writer.WriteCollectionOfObjectValues("volumes", Volumes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesRequestBuilder.cs new file mode 100644 index 0000000..920dae8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesRequestBuilder.cs @@ -0,0 +1,161 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Dangerous; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Retry; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Selective; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Status; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\destroy_with_associated_resources + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Destroy_with_associated_resourcesRequestBuilder : BaseRequestBuilder + { + /// The dangerous property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder Dangerous + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder(PathParameters, RequestAdapter); + } + /// The retry property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Retry.RetryRequestBuilder Retry + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Retry.RetryRequestBuilder(PathParameters, RequestAdapter); + } + /// The selective property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder Selective + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder(PathParameters, RequestAdapter); + } + /// The status property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Status.StatusRequestBuilder Status + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Status.StatusRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Destroy_with_associated_resourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Destroy_with_associated_resourcesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources", rawUrl) + { + } + /// + /// To list the associated billable resources that can be destroyed along with aDroplet, send a GET request to the`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources` endpoint.The response will be a JSON object containing `snapshots`, `volumes`, and`volume_snapshots` keys. Each will be set to an array of objects containinginformation about the associated resources. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDestroy_with_associated_resourcesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDestroy_with_associated_resourcesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list the associated billable resources that can be destroyed along with aDroplet, send a GET request to the`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources` endpoint.The response will be a JSON object containing `snapshots`, `volumes`, and`volume_snapshots` keys. Each will be set to an array of objects containinginformation about the associated resources. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDestroy_with_associated_resourcesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list the associated billable resources that can be destroyed along with aDroplet, send a GET request to the`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources` endpoint.The response will be a JSON object containing `snapshots`, `volumes`, and`volume_snapshots` keys. Each will be set to an array of objects containinginformation about the associated resources. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Destroy_with_associated_resourcesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesResponse.cs new file mode 100644 index 0000000..566249b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources +{ + [Obsolete("This class is obsolete. Use Destroy_with_associated_resourcesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Destroy_with_associated_resourcesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Retry/RetryRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Retry/RetryRequestBuilder.cs new file mode 100644 index 0000000..6d9eb15 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Retry/RetryRequestBuilder.cs @@ -0,0 +1,106 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Retry +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\destroy_with_associated_resources\retry + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RetryRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RetryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/retry", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RetryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/retry", rawUrl) + { + } + /// + /// If the status of a request to destroy a Droplet with its associated resourcesreported any errors, it can be retried by sending a POST request to the`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry` endpoint.Only one destroy can be active at a time per Droplet. If a retry is issuedwhile another destroy is in progress for the Droplet a 409 status code willbe returned. A successful response will include a 202 response code and nocontent. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "409", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// If the status of a request to destroy a Droplet with its associated resourcesreported any errors, it can be retried by sending a POST request to the`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry` endpoint.Only one destroy can be active at a time per Droplet. If a retry is issuedwhile another destroy is in progress for the Droplet a 409 status code willbe returned. A successful response will include a 202 response code and nocontent. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Retry.RetryRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Retry.RetryRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RetryRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Selective/SelectiveRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Selective/SelectiveRequestBuilder.cs new file mode 100644 index 0000000..eb09f89 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Selective/SelectiveRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Selective +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\destroy_with_associated_resources\selective + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SelectiveRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SelectiveRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/selective", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SelectiveRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/selective", rawUrl) + { + } + /// + /// To destroy a Droplet along with a sub-set of its associated resources, send aDELETE request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`endpoint. The JSON body of the request should include `reserved_ips`, `snapshots`, `volumes`,or `volume_snapshots` keys each set to an array of IDs for the associatedresources to be destroyed. The IDs can be found by querying the Droplet'sassociated resources. Any associated resource not included in the requestwill remain and continue to accrue changes on your account.A successful response will include a 202 response code and no content. Usethe status endpoint to check on the success or failure of the destruction ofthe individual resources. + /// + /// An object containing information about a resource to be scheduled for deletion. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Selective_destroy_associated_resource body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Selective_destroy_associated_resource body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To destroy a Droplet along with a sub-set of its associated resources, send aDELETE request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`endpoint. The JSON body of the request should include `reserved_ips`, `snapshots`, `volumes`,or `volume_snapshots` keys each set to an array of IDs for the associatedresources to be destroyed. The IDs can be found by querying the Droplet'sassociated resources. Any associated resource not included in the requestwill remain and continue to accrue changes on your account.A successful response will include a 202 response code and no content. Usethe status endpoint to check on the success or failure of the destruction ofthe individual resources. + /// + /// A + /// An object containing information about a resource to be scheduled for deletion. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Selective_destroy_associated_resource body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Selective_destroy_associated_resource body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SelectiveRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Status/StatusRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Status/StatusRequestBuilder.cs new file mode 100644 index 0000000..d4d5ceb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Destroy_with_associated_resources/Status/StatusRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Status +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\destroy_with_associated_resources\status + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class StatusRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StatusRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/status", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StatusRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/destroy_with_associated_resources/status", rawUrl) + { + } + /// + /// To check on the status of a request to destroy a Droplet with its associatedresources, send a GET request to the`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status` endpoint. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Associated_resource_status.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To check on the status of a request to destroy a Droplet with its associatedresources, send a GET request to the`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status` endpoint. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Status.StatusRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Status.StatusRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class StatusRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsGetResponse.cs new file mode 100644 index 0000000..c5aac2a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The firewalls property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Firewalls { get; set; } +#nullable restore +#else + public List Firewalls { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FirewallsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "firewalls", n => { Firewalls = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("firewalls", Firewalls); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsRequestBuilder.cs new file mode 100644 index 0000000..f31c846 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\firewalls + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FirewallsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/firewalls{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FirewallsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/firewalls{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve a list of all firewalls available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/firewalls`The response will be a JSON object that has a key called `firewalls`. This willbe set to an array of `firewall` objects, each of which contain the standard`firewall` attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsFirewallsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsFirewallsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all firewalls available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/firewalls`The response will be a JSON object that has a key called `firewalls`. This willbe set to an array of `firewall` objects, each of which contain the standard`firewall` attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsFirewallsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all firewalls available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/firewalls`The response will be a JSON object that has a key called `firewalls`. This willbe set to an array of `firewall` objects, each of which contain the standard`firewall` attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve a list of all firewalls available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/firewalls`The response will be a JSON object that has a key called `firewalls`. This willbe set to an array of `firewall` objects, each of which contain the standard`firewall` attributes. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsResponse.cs new file mode 100644 index 0000000..0dbe907 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Firewalls/FirewallsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls +{ + [Obsolete("This class is obsolete. Use FirewallsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsGetResponse.cs new file mode 100644 index 0000000..ee3af6f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class KernelsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kernels property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Kernels { get; set; } +#nullable restore +#else + public List Kernels { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public KernelsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kernels", n => { Kernels = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kernel.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("kernels", Kernels); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsRequestBuilder.cs new file mode 100644 index 0000000..fc471a7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\kernels + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KernelsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public KernelsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/kernels{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public KernelsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/kernels{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve a list of all kernels available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/kernels`The response will be a JSON object that has a key called `kernels`. This willbe set to an array of `kernel` objects, each of which contain the standard`kernel` attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsKernelsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsKernelsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all kernels available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/kernels`The response will be a JSON object that has a key called `kernels`. This willbe set to an array of `kernel` objects, each of which contain the standard`kernel` attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsKernelsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all kernels available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/kernels`The response will be a JSON object that has a key called `kernels`. This willbe set to an array of `kernel` objects, each of which contain the standard`kernel` attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve a list of all kernels available to a Droplet, send a GET requestto `/v2/droplets/$DROPLET_ID/kernels`The response will be a JSON object that has a key called `kernels`. This willbe set to an array of `kernel` objects, each of which contain the standard`kernel` attributes. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KernelsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KernelsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsResponse.cs new file mode 100644 index 0000000..ed64fcb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Kernels/KernelsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels +{ + [Obsolete("This class is obsolete. Use KernelsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class KernelsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsGetResponse.cs new file mode 100644 index 0000000..a0991ab --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class NeighborsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplets property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Droplets { get; set; } +#nullable restore +#else + public List Droplets { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NeighborsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplets", n => { Droplets = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Droplet.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("droplets", Droplets); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsRequestBuilder.cs new file mode 100644 index 0000000..350e4fc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\neighbors + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class NeighborsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NeighborsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/neighbors", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NeighborsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/neighbors", rawUrl) + { + } + /// + /// To retrieve a list of any "neighbors" (i.e. Droplets that are co-located onthe same physical hardware) for a specific Droplet, send a GET request to`/v2/droplets/$DROPLET_ID/neighbors`.The results will be returned as a JSON object with a key of `droplets`. Thiswill be set to an array containing objects representing any other Dropletsthat share the same physical hardware. An empty array indicates that theDroplet is not co-located any other Droplets associated with your account. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsNeighborsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsNeighborsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of any "neighbors" (i.e. Droplets that are co-located onthe same physical hardware) for a specific Droplet, send a GET request to`/v2/droplets/$DROPLET_ID/neighbors`.The results will be returned as a JSON object with a key of `droplets`. Thiswill be set to an array containing objects representing any other Dropletsthat share the same physical hardware. An empty array indicates that theDroplet is not co-located any other Droplets associated with your account. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsNeighborsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of any "neighbors" (i.e. Droplets that are co-located onthe same physical hardware) for a specific Droplet, send a GET request to`/v2/droplets/$DROPLET_ID/neighbors`.The results will be returned as a JSON object with a key of `droplets`. Thiswill be set to an array containing objects representing any other Dropletsthat share the same physical hardware. An empty array indicates that theDroplet is not co-located any other Droplets associated with your account. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class NeighborsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsResponse.cs new file mode 100644 index 0000000..4ea52ac --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Neighbors/NeighborsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors +{ + [Obsolete("This class is obsolete. Use NeighborsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class NeighborsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsGetResponse.cs new file mode 100644 index 0000000..d7055ac --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The snapshots property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Snapshots { get; set; } +#nullable restore +#else + public List Snapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SnapshotsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "snapshots", n => { Snapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Droplet_snapshot.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("snapshots", Snapshots); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsRequestBuilder.cs new file mode 100644 index 0000000..303df7b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id}\snapshots + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/snapshots{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}/snapshots{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve the snapshots that have been created from a Droplet, send a GETrequest to `/v2/droplets/$DROPLET_ID/snapshots`.You will get back a JSON object that has a `snapshots` key. This will be setto an array of snapshot objects, each of which contain the standard Dropletsnapshot attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsSnapshotsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsSnapshotsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the snapshots that have been created from a Droplet, send a GETrequest to `/v2/droplets/$DROPLET_ID/snapshots`.You will get back a JSON object that has a `snapshots` key. This will be setto an array of snapshot objects, each of which contain the standard Dropletsnapshot attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsSnapshotsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the snapshots that have been created from a Droplet, send a GETrequest to `/v2/droplets/$DROPLET_ID/snapshots`.You will get back a JSON object that has a `snapshots` key. This will be setto an array of snapshot objects, each of which contain the standard Dropletsnapshot attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve the snapshots that have been created from a Droplet, send a GETrequest to `/v2/droplets/$DROPLET_ID/snapshots`.You will get back a JSON object that has a `snapshots` key. This will be setto an array of snapshot objects, each of which contain the standard Dropletsnapshot attributes. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsResponse.cs new file mode 100644 index 0000000..16661e3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/Snapshots/SnapshotsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots +{ + [Obsolete("This class is obsolete. Use SnapshotsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_GetResponse.cs new file mode 100644 index 0000000..f311cb2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDroplet_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplet property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet? Droplet { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Droplet Droplet { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDroplet_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet", n => { Droplet = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Droplet.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("droplet", Droplet); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_ItemRequestBuilder.cs new file mode 100644 index 0000000..d665ce0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_ItemRequestBuilder.cs @@ -0,0 +1,230 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors; +using InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item +{ + /// + /// Builds and executes requests for operations under \v2\droplets\{droplet_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDroplet_ItemRequestBuilder : BaseRequestBuilder + { + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The destroy_with_associated_resources property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder Destroy_with_associated_resources + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder(PathParameters, RequestAdapter); + } + /// The firewalls property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsRequestBuilder Firewalls + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Firewalls.FirewallsRequestBuilder(PathParameters, RequestAdapter); + } + /// The kernels property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsRequestBuilder Kernels + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Kernels.KernelsRequestBuilder(PathParameters, RequestAdapter); + } + /// The neighbors property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsRequestBuilder Neighbors + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Neighbors.NeighborsRequestBuilder(PathParameters, RequestAdapter); + } + /// The snapshots property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsRequestBuilder Snapshots + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.Snapshots.SnapshotsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDroplet_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDroplet_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/droplets/{droplet_id}", rawUrl) + { + } + /// + /// To delete a Droplet, send a DELETE request to `/v2/droplets/$DROPLET_ID`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an individual Droplet, send a GET request to`/v2/droplets/$DROPLET_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithDroplet_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithDroplet_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an individual Droplet, send a GET request to`/v2/droplets/$DROPLET_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithDroplet_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a Droplet, send a DELETE request to `/v2/droplets/$DROPLET_ID`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an individual Droplet, send a GET request to`/v2/droplets/$DROPLET_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDroplet_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDroplet_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_Response.cs new file mode 100644 index 0000000..b00ca1b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Droplets/Item/WithDroplet_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Droplets.Item +{ + [Obsolete("This class is obsolete. Use WithDroplet_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDroplet_Response : global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.Item.WithDroplet_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsGetResponse.cs new file mode 100644 index 0000000..f335c54 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The firewalls property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Firewalls { get; set; } +#nullable restore +#else + public List Firewalls { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FirewallsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "firewalls", n => { Firewalls = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Firewall.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("firewalls", Firewalls); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsPostResponse.cs new file mode 100644 index 0000000..6f09d40 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The firewall property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall? Firewall { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall Firewall { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FirewallsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "firewall", n => { Firewall = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Firewall.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("firewall", Firewall); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsRequestBuilder.cs new file mode 100644 index 0000000..88fc601 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsRequestBuilder.cs @@ -0,0 +1,269 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls +{ + /// + /// Builds and executes requests for operations under \v2\firewalls + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.firewalls.item collection + /// A unique ID that can be used to identify and reference a firewall. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("firewall_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.firewalls.item collection + /// A unique ID that can be used to identify and reference a firewall. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("firewall_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FirewallsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FirewallsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the firewalls available on your account, send a GET request to `/v2/firewalls`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsFirewallsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsFirewallsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the firewalls available on your account, send a GET request to `/v2/firewalls`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsFirewallsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new firewall, send a POST request to `/v2/firewalls`. The requestmust contain at least one inbound or outbound access rule. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsFirewallsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsFirewallsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new firewall, send a POST request to `/v2/firewalls`. The requestmust contain at least one inbound or outbound access rule. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsFirewallsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the firewalls available on your account, send a GET request to `/v2/firewalls`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new firewall, send a POST request to `/v2/firewalls`. The requestmust contain at least one inbound or outbound access rule. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the firewalls available on your account, send a GET request to `/v2/firewalls`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FirewallsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsResponse.cs new file mode 100644 index 0000000..5b1d4f0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/FirewallsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls +{ + [Obsolete("This class is obsolete. Use FirewallsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class FirewallsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsDeleteRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsDeleteRequestBody.cs new file mode 100644 index 0000000..4dbdeb2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsDeleteRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsDeleteRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array containing the IDs of the Droplets to be removed from the firewall. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; set; } +#nullable restore +#else + public List DropletIds { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DropletsDeleteRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsDeleteRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsDeleteRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("droplet_ids", DropletIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsPostRequestBody.cs new file mode 100644 index 0000000..b610aa8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsPostRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array containing the IDs of the Droplets to be assigned to the firewall. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; set; } +#nullable restore +#else + public List DropletIds { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DropletsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("droplet_ids", DropletIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsRequestBuilder.cs new file mode 100644 index 0000000..9191faf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Droplets/DropletsRequestBuilder.cs @@ -0,0 +1,175 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets +{ + /// + /// Builds and executes requests for operations under \v2\firewalls\{firewall_id}\droplets + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DropletsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}/droplets", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DropletsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}/droplets", rawUrl) + { + } + /// + /// To remove a Droplet from a firewall, send a DELETE request to`/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, there shouldbe a `droplet_ids` attribute containing a list of Droplet IDs.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsDeleteRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsDeleteRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To assign a Droplet to a firewall, send a POST request to`/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, thereshould be a `droplet_ids` attribute containing a list of Droplet IDs.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To remove a Droplet from a firewall, send a DELETE request to`/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, there shouldbe a `droplet_ids` attribute containing a list of Droplet IDs.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsDeleteRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsDeleteRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To assign a Droplet to a firewall, send a POST request to`/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, thereshould be a `droplet_ids` attribute containing a list of Droplet IDs.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Rules/RulesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Rules/RulesRequestBuilder.cs new file mode 100644 index 0000000..2cb6e02 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Rules/RulesRequestBuilder.cs @@ -0,0 +1,175 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Rules +{ + /// + /// Builds and executes requests for operations under \v2\firewalls\{firewall_id}\rules + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RulesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RulesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}/rules", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RulesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}/rules", rawUrl) + { + } + /// + /// To remove access rules from a firewall, send a DELETE request to`/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include an`inbound_rules` and/or `outbound_rules` attribute containing an array of rulesto be removed.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add additional access rules to a firewall, send a POST request to`/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include aninbound_rules and/or outbound_rules attribute containing an array of rules tobe added.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To remove access rules from a firewall, send a DELETE request to`/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include an`inbound_rules` and/or `outbound_rules` attribute containing an array of rulesto be removed.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To add additional access rules to a firewall, send a POST request to`/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include aninbound_rules and/or outbound_rules attribute containing an array of rules tobe added.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall_rules body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Rules.RulesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Rules.RulesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RulesRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RulesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsDeleteRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsDeleteRequestBody.cs new file mode 100644 index 0000000..23a0b1f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsDeleteRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TagsDeleteRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TagsDeleteRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsDeleteRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsDeleteRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsPostRequestBody.cs new file mode 100644 index 0000000..d27ca8b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsPostRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TagsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TagsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsRequestBuilder.cs new file mode 100644 index 0000000..3c01a76 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/Tags/TagsRequestBuilder.cs @@ -0,0 +1,175 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags +{ + /// + /// Builds and executes requests for operations under \v2\firewalls\{firewall_id}\tags + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TagsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}/tags", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}/tags", rawUrl) + { + } + /// + /// To remove a tag representing a group of Droplets from a firewall, send aDELETE request to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of therequest, there should be a `tags` attribute containing a list of tag names.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsDeleteRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsDeleteRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To assign a tag representing a group of Droplets to a firewall, send a POSTrequest to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of the request,there should be a `tags` attribute containing a list of tag names.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To remove a tag representing a group of Droplets from a firewall, send aDELETE request to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of therequest, there should be a `tags` attribute containing a list of tag names.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsDeleteRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsDeleteRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To assign a tag representing a group of Droplets to a firewall, send a POSTrequest to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of the request,there should be a `tags` attribute containing a list of tag names.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_GetResponse.cs new file mode 100644 index 0000000..3561057 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithFirewall_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The firewall property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall? Firewall { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall Firewall { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithFirewall_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "firewall", n => { Firewall = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Firewall.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("firewall", Firewall); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_ItemRequestBuilder.cs new file mode 100644 index 0000000..c570566 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_ItemRequestBuilder.cs @@ -0,0 +1,313 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets; +using InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Rules; +using InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item +{ + /// + /// Builds and executes requests for operations under \v2\firewalls\{firewall_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithFirewall_ItemRequestBuilder : BaseRequestBuilder + { + /// The droplets property + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsRequestBuilder Droplets + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Droplets.DropletsRequestBuilder(PathParameters, RequestAdapter); + } + /// The rules property + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Rules.RulesRequestBuilder Rules + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Rules.RulesRequestBuilder(PathParameters, RequestAdapter); + } + /// The tags property + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsRequestBuilder Tags + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.Tags.TagsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFirewall_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFirewall_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/firewalls/{firewall_id}", rawUrl) + { + } + /// + /// To delete a firewall send a DELETE request to `/v2/firewalls/$FIREWALL_ID`.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing firewall, send a GET request to `/v2/firewalls/$FIREWALL_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithFirewall_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithFirewall_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing firewall, send a GET request to `/v2/firewalls/$FIREWALL_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithFirewall_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the configuration of an existing firewall, send a PUT request to`/v2/firewalls/$FIREWALL_ID`. The request should contain a full representationof the firewall including existing attributes. **Note that any attributes thatare not provided will be reset to their default values.** + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithFirewall_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithFirewall_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the configuration of an existing firewall, send a PUT request to`/v2/firewalls/$FIREWALL_ID`. The request should contain a full representationof the firewall including existing attributes. **Note that any attributes thatare not provided will be reset to their default values.** + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithFirewall_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a firewall send a DELETE request to `/v2/firewalls/$FIREWALL_ID`.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing firewall, send a GET request to `/v2/firewalls/$FIREWALL_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the configuration of an existing firewall, send a PUT request to`/v2/firewalls/$FIREWALL_ID`. The request should contain a full representationof the firewall including existing attributes. **Note that any attributes thatare not provided will be reset to their default values.** + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Firewall body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithFirewall_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithFirewall_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithFirewall_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_PutResponse.cs new file mode 100644 index 0000000..d4fb881 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithFirewall_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The firewall property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall? Firewall { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Firewall Firewall { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithFirewall_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "firewall", n => { Firewall = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Firewall.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("firewall", Firewall); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_Response.cs new file mode 100644 index 0000000..39daaec --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Firewalls/Item/WithFirewall_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item +{ + [Obsolete("This class is obsolete. Use WithFirewall_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithFirewall_Response : global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.Item.WithFirewall_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsGetResponse.cs new file mode 100644 index 0000000..282af49 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ipsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The floating_ips property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FloatingIps { get; set; } +#nullable restore +#else + public List FloatingIps { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Floating_ipsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "floating_ips", n => { FloatingIps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("floating_ips", FloatingIps); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsPostResponse.cs new file mode 100644 index 0000000..63dc2ea --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsPostResponse.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ipsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The floating_ip property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip? FloatingIp { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip FloatingIp { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse_links Links { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Floating_ipsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "floating_ip", n => { FloatingIp = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse_links.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("floating_ip", FloatingIp); + writer.WriteObjectValue("links", Links); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsPostResponse_links.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsPostResponse_links.cs new file mode 100644 index 0000000..2e5a269 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsPostResponse_links.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ipsPostResponse_links : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplets property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Droplets { get; set; } +#nullable restore +#else + public List Droplets { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Floating_ipsPostResponse_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Action_link.CreateFromDiscriminatorValue)?.AsList(); } }, + { "droplets", n => { Droplets = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Action_link.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteCollectionOfObjectValues("droplets", Droplets); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsRequestBuilder.cs new file mode 100644 index 0000000..7e6d6b7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsRequestBuilder.cs @@ -0,0 +1,296 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips +{ + /// + /// Builds and executes requests for operations under \v2\floating_ips + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Floating_ipsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.floating_ips.item collection + /// A floating IP address. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("floating_ip", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Floating_ipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Floating_ipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the floating IPs available on your account, send a GET request to `/v2/floating_ips`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsFloating_ipsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsFloating_ipsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the floating IPs available on your account, send a GET request to `/v2/floating_ips`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsFloating_ipsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// On creation, a floating IP must be either assigned to a Droplet or reserved to a region.* To create a new floating IP assigned to a Droplet, send a POST request to `/v2/floating_ips` with the `droplet_id` attribute.* To create a new floating IP reserved to a region, send a POST request to `/v2/floating_ips` with the `region` attribute.**Note**: In addition to the standard rate limiting, only 12 floating IPs may be created per 60 seconds. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsFloating_ipsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsFloating_ipsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + + /// + /// To list all of the floating IPs available on your account, send a GET request to `/v2/floating_ips`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// On creation, a floating IP must be either assigned to a Droplet or reserved to a region.* To create a new floating IP assigned to a Droplet, send a POST request to `/v2/floating_ips` with the `droplet_id` attribute.* To create a new floating IP reserved to a region, send a POST request to `/v2/floating_ips` with the `region` attribute.**Note**: In addition to the standard rate limiting, only 12 floating IPs may be created per 60 seconds. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_create body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_create body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the floating IPs available on your account, send a GET request to `/v2/floating_ips`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Floating_ipsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Floating_ipsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Floating_ipsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Floating_ip_create : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1? FloatingIpCreateMember1 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1 FloatingIpCreateMember1 { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2? FloatingIpCreateMember2 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2 FloatingIpCreateMember2 { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsRequestBuilder.Floating_ip_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsRequestBuilder.Floating_ip_create(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.FloatingIpCreateMember1 = new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember1(); + } + else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.FloatingIpCreateMember2 = new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_createMember2(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(FloatingIpCreateMember1 != null) + { + return FloatingIpCreateMember1.GetFieldDeserializers(); + } + else if(FloatingIpCreateMember2 != null) + { + return FloatingIpCreateMember2.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(FloatingIpCreateMember1 != null) + { + writer.WriteObjectValue(null, FloatingIpCreateMember1); + } + else if(FloatingIpCreateMember2 != null) + { + writer.WriteObjectValue(null, FloatingIpCreateMember2); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsResponse.cs new file mode 100644 index 0000000..4cf1b7f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Floating_ipsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips +{ + [Obsolete("This class is obsolete. Use Floating_ipsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Floating_ipsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionObject.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionObject.cs new file mode 100644 index 0000000..eab9822 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionObject.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class ActionObject : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionObject CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionObject(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsGetResponse.cs new file mode 100644 index 0000000..847e310 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ActionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsPostResponse.cs new file mode 100644 index 0000000..d8ad1da --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsPostResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse_action? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse_action Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ActionsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse_action.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsPostResponse_action.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsPostResponse_action.cs new file mode 100644 index 0000000..239f17d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsPostResponse_action.cs @@ -0,0 +1,51 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse_action : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse_action CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse_action(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..2d349a5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,317 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions +{ + /// + /// Builds and executes requests for operations under \v2\floating_ips\{floating_ip}\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.floating_ips.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.floating_ips.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips/{floating_ip}/actions", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips/{floating_ip}/actions", rawUrl) + { + } + /// + /// To retrieve all actions that have been executed on a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsActionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsActionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsActionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a floating IP send a POST request to`/v2/floating_ips/$FLOATING_IP/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details|------------|--------| `assign` | Assigns a floating IP to a Droplet| `unassign` | Unassign a floating IP from a Droplet + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a floating IP send a POST request to`/v2/floating_ips/$FLOATING_IP/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details|------------|--------| `assign` | Assigns a floating IP to a Droplet| `unassign` | Unassign a floating IP from a Droplet + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsActionsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To initiate an action on a floating IP send a POST request to`/v2/floating_ips/$FLOATING_IP/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details|------------|--------| `assign` | Assigns a floating IP to a Droplet| `unassign` | Unassign a floating IP from a Droplet + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_assign? FloatingIpActionAssign { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_assign FloatingIpActionAssign { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_unassign? FloatingIpActionUnassign { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_unassign FloatingIpActionUnassign { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody(); + result.FloatingIpActionAssign = new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_assign(); + result.FloatingIpActionUnassign = new global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip_action_unassign(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(FloatingIpActionAssign != null || FloatingIpActionUnassign != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(FloatingIpActionAssign, FloatingIpActionUnassign); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, FloatingIpActionAssign, FloatingIpActionUnassign); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsResponse.cs new file mode 100644 index 0000000..b5ecca6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions +{ + [Obsolete("This class is obsolete. Use ActionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/ActionObject.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/ActionObject.cs new file mode 100644 index 0000000..ca480df --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/ActionObject.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class ActionObject : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.ActionObject CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.ActionObject(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_GetResponse.cs new file mode 100644 index 0000000..77b2033 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_GetResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse_action? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse_action Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithAction_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse_action.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_GetResponse_action.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_GetResponse_action.cs new file mode 100644 index 0000000..2ed5315 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_GetResponse_action.cs @@ -0,0 +1,51 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_GetResponse_action : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse_action CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse_action(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_ItemRequestBuilder.cs new file mode 100644 index 0000000..7c295e3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_ItemRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item +{ + /// + /// Builds and executes requests for operations under \v2\floating_ips\{floating_ip}\actions\{action_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips/{floating_ip}/actions/{action_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips/{floating_ip}/actions/{action_id}", rawUrl) + { + } + /// + /// To retrieve the status of a floating IP action, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithAction_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithAction_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of a floating IP action, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithAction_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of a floating IP action, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions/$ACTION_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_Response.cs new file mode 100644 index 0000000..5e58bf2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/Actions/Item/WithAction_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item +{ + [Obsolete("This class is obsolete. Use WithAction_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_Response : global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.Item.WithAction_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipGetResponse.cs new file mode 100644 index 0000000..373c081 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithFloating_ipGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The floating_ip property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip? FloatingIp { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip FloatingIp { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithFloating_ipGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "floating_ip", n => { FloatingIp = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Floating_ip.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("floating_ip", FloatingIp); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipItemRequestBuilder.cs new file mode 100644 index 0000000..09c2ff9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipItemRequestBuilder.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item +{ + /// + /// Builds and executes requests for operations under \v2\floating_ips\{floating_ip} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithFloating_ipItemRequestBuilder : BaseRequestBuilder + { + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFloating_ipItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips/{floating_ip}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFloating_ipItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/floating_ips/{floating_ip}", rawUrl) + { + } + /// + /// To delete a floating IP and remove it from your account, send a DELETE requestto `/v2/floating_ips/$FLOATING_IP_ADDR`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP_ADDR`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithFloating_ipGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithFloating_ipGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP_ADDR`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithFloating_ipGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a floating IP and remove it from your account, send a DELETE requestto `/v2/floating_ips/$FLOATING_IP_ADDR`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP_ADDR`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithFloating_ipItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithFloating_ipItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipResponse.cs new file mode 100644 index 0000000..bef38f7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Floating_ips/Item/WithFloating_ipResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item +{ + [Obsolete("This class is obsolete. Use WithFloating_ipGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithFloating_ipResponse : global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Item.WithFloating_ipResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/FunctionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/FunctionsRequestBuilder.cs new file mode 100644 index 0000000..1698a54 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/FunctionsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions +{ + /// + /// Builds and executes requests for operations under \v2\functions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class FunctionsRequestBuilder : BaseRequestBuilder + { + /// The namespaces property + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesRequestBuilder Namespaces + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FunctionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FunctionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameGetResponse.cs new file mode 100644 index 0000000..f92b1c6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTrigger_nameGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The trigger property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info? Trigger { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info Trigger { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithTrigger_nameGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "trigger", n => { Trigger = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("trigger", Trigger); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameItemRequestBuilder.cs new file mode 100644 index 0000000..17447e0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameItemRequestBuilder.cs @@ -0,0 +1,295 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item +{ + /// + /// Builds and executes requests for operations under \v2\functions\namespaces\{namespace_id}\triggers\{trigger_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTrigger_nameItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTrigger_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces/{namespace_id}/triggers/{trigger_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTrigger_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces/{namespace_id}/triggers/{trigger_name}", rawUrl) + { + } + /// + /// Deletes the given trigger.To delete trigger, send a DELETE request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME`.A successful deletion returns a 204 response. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the trigger details. To get the trigger details, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithTrigger_nameGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithTrigger_nameGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the trigger details. To get the trigger details, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithTrigger_nameGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates the details of the given trigger. To update a trigger, send a PUT request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME` with new values for the `is_enabled ` or `scheduled_details` properties. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithTrigger_namePutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithTrigger_namePutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_namePutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates the details of the given trigger. To update a trigger, send a PUT request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME` with new values for the `is_enabled ` or `scheduled_details` properties. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithTrigger_namePutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes the given trigger.To delete trigger, send a DELETE request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME`.A successful deletion returns a 204 response. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Gets the trigger details. To get the trigger details, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Updates the details of the given trigger. To update a trigger, send a PUT request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME` with new values for the `is_enabled ` or `scheduled_details` properties. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Update_trigger body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTrigger_nameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTrigger_nameItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTrigger_nameItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_namePutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_namePutResponse.cs new file mode 100644 index 0000000..90965f6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_namePutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTrigger_namePutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The trigger property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info? Trigger { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info Trigger { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithTrigger_namePutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_namePutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_namePutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "trigger", n => { Trigger = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("trigger", Trigger); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameResponse.cs new file mode 100644 index 0000000..2493fa2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/Item/WithTrigger_nameResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item +{ + [Obsolete("This class is obsolete. Use WithTrigger_nameGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTrigger_nameResponse : global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersGetResponse.cs new file mode 100644 index 0000000..1d27663 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TriggersGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The triggers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Triggers { get; set; } +#nullable restore +#else + public List Triggers { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TriggersGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "triggers", n => { Triggers = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("triggers", Triggers); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersPostResponse.cs new file mode 100644 index 0000000..612c6f0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TriggersPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The trigger property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info? Trigger { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info Trigger { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TriggersPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "trigger", n => { Trigger = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Trigger_info.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("trigger", Trigger); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersRequestBuilder.cs new file mode 100644 index 0000000..97862d5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersRequestBuilder.cs @@ -0,0 +1,255 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers +{ + /// + /// Builds and executes requests for operations under \v2\functions\namespaces\{namespace_id}\triggers + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TriggersRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.functions.namespaces.item.triggers.item collection + /// The name of the trigger to be managed. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("trigger_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.Item.WithTrigger_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TriggersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces/{namespace_id}/triggers", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TriggersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces/{namespace_id}/triggers", rawUrl) + { + } + /// + /// Returns a list of triggers associated with the current user and namespace. To get all triggers, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsTriggersGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsTriggersGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of triggers associated with the current user and namespace. To get all triggers, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsTriggersGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new trigger for a given function in a namespace. To create a trigger, send a POST request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers` with the `name`, `function`, `type`, `is_enabled` and `scheduled_details` properties. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 422 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsTriggersPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsTriggersPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "422", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new trigger for a given function in a namespace. To create a trigger, send a POST request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers` with the `name`, `function`, `type`, `is_enabled` and `scheduled_details` properties. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 422 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsTriggersPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "422", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of triggers associated with the current user and namespace. To get all triggers, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Creates a new trigger for a given function in a namespace. To create a trigger, send a POST request to `/v2/functions/namespaces/$NAMESPACE_ID/triggers` with the `name`, `function`, `type`, `is_enabled` and `scheduled_details` properties. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Create_trigger body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TriggersRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TriggersRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersResponse.cs new file mode 100644 index 0000000..7495066 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/Triggers/TriggersResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers +{ + [Obsolete("This class is obsolete. Use TriggersGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TriggersResponse : global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_GetResponse.cs new file mode 100644 index 0000000..04552fc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithNamespace_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The namespace property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info? Namespace { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info Namespace { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithNamespace_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "namespace", n => { Namespace = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("namespace", Namespace); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_ItemRequestBuilder.cs new file mode 100644 index 0000000..6ef9323 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_ItemRequestBuilder.cs @@ -0,0 +1,204 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item +{ + /// + /// Builds and executes requests for operations under \v2\functions\namespaces\{namespace_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNamespace_ItemRequestBuilder : BaseRequestBuilder + { + /// The triggers property + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersRequestBuilder Triggers + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.Triggers.TriggersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNamespace_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces/{namespace_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNamespace_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces/{namespace_id}", rawUrl) + { + } + /// + /// Deletes the given namespace. When a namespace is deleted all assets, in the namespace are deleted, this includes packages, functions and triggers. Deleting a namespace is a destructive operation and assets in the namespace are not recoverable after deletion. Some metadata is retained, such as activations, or soft deleted for reporting purposes.To delete namespace, send a DELETE request to `/v2/functions/namespaces/$NAMESPACE_ID`.A successful deletion returns a 204 response. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the namespace details for the given namespace UUID. To get namespace details, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID` with no parameters. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithNamespace_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithNamespace_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "403", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the namespace details for the given namespace UUID. To get namespace details, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID` with no parameters. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithNamespace_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "403", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes the given namespace. When a namespace is deleted all assets, in the namespace are deleted, this includes packages, functions and triggers. Deleting a namespace is a destructive operation and assets in the namespace are not recoverable after deletion. Some metadata is retained, such as activations, or soft deleted for reporting purposes.To delete namespace, send a DELETE request to `/v2/functions/namespaces/$NAMESPACE_ID`.A successful deletion returns a 204 response. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Gets the namespace details for the given namespace UUID. To get namespace details, send a GET request to `/v2/functions/namespaces/$NAMESPACE_ID` with no parameters. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNamespace_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNamespace_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_Response.cs new file mode 100644 index 0000000..a8dad24 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/Item/WithNamespace_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item +{ + [Obsolete("This class is obsolete. Use WithNamespace_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithNamespace_Response : global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesGetResponse.cs new file mode 100644 index 0000000..a73f2d7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class NamespacesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The namespaces property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Namespaces { get; set; } +#nullable restore +#else + public List Namespaces { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NamespacesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "namespaces", n => { Namespaces = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("namespaces", Namespaces); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesPostResponse.cs new file mode 100644 index 0000000..d106634 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class NamespacesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The namespace property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info? Namespace { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info Namespace { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NamespacesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "namespace", n => { Namespace = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Namespace_info.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("namespace", Namespace); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesRequestBuilder.cs new file mode 100644 index 0000000..8c6f021 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces +{ + /// + /// Builds and executes requests for operations under \v2\functions\namespaces + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class NamespacesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.functions.namespaces.item collection + /// The ID of the namespace to be managed. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("namespace_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.Item.WithNamespace_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NamespacesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NamespacesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/functions/namespaces", rawUrl) + { + } + /// + /// Returns a list of namespaces associated with the current user. To get all namespaces, send a GET request to `/v2/functions/namespaces`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsNamespacesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsNamespacesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of namespaces associated with the current user. To get all namespaces, send a GET request to `/v2/functions/namespaces`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsNamespacesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new serverless functions namespace in the desired region and associates it with the provided label. A namespace is a collection of functions and their associated packages, triggers, and project specifications. To create a namespace, send a POST request to `/v2/functions/namespaces` with the `region` and `label` properties. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 422 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsNamespacesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsNamespacesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "422", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new serverless functions namespace in the desired region and associates it with the provided label. A namespace is a collection of functions and their associated packages, triggers, and project specifications. To create a namespace, send a POST request to `/v2/functions/namespaces` with the `region` and `label` properties. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 422 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsNamespacesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "422", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of namespaces associated with the current user. To get all namespaces, send a GET request to `/v2/functions/namespaces`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Creates a new serverless functions namespace in the desired region and associates it with the provided label. A namespace is a collection of functions and their associated packages, triggers, and project specifications. To create a namespace, send a POST request to `/v2/functions/namespaces` with the `region` and `label` properties. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Create_namespace body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class NamespacesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class NamespacesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesResponse.cs new file mode 100644 index 0000000..fb62960 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Functions/Namespaces/NamespacesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces +{ + [Obsolete("This class is obsolete. Use NamespacesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class NamespacesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Functions.Namespaces.NamespacesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/GetTypeQueryParameterType.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/GetTypeQueryParameterType.cs new file mode 100644 index 0000000..811ffac --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/GetTypeQueryParameterType.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum GetTypeQueryParameterType + #pragma warning restore CS1591 + { + [EnumMember(Value = "application")] + #pragma warning disable CS1591 + Application, + #pragma warning restore CS1591 + [EnumMember(Value = "distribution")] + #pragma warning disable CS1591 + Distribution, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesGetResponse.cs new file mode 100644 index 0000000..07ff6ce --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ImagesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The images property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Images { get; set; } +#nullable restore +#else + public List Images { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImagesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "images", n => { Images = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Image.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("images", Images); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesPostResponse.cs new file mode 100644 index 0000000..1302439 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ImagesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Image? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Image Image { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImagesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Image.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("image", Image); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..52e8c70 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesRequestBuilder.cs @@ -0,0 +1,292 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Images.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images +{ + /// + /// Builds and executes requests for operations under \v2\images + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ImagesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.images.item collection + /// A unique number (id) or string (slug) used to identify and reference aspecific image.**Public** images can be identified by image `id` or `slug`.**Private** images *must* be identified by image `id`. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("image_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.images.item collection + /// A unique number (id) or string (slug) used to identify and reference aspecific image.**Public** images can be identified by image `id` or `slug`.**Private** images *must* be identified by image `id`. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("image_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images{?page*,per_page*,private*,tag_name*,type*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images{?page*,per_page*,private*,tag_name*,type*}", rawUrl) + { + } + /// + /// To list all of the images available on your account, send a GET request to /v2/images.## Filtering Results-----It's possible to request filtered results by including certain query parameters.**Image Type**Either 1-Click Application or OS Distribution images can be filtered by using the `type` query parameter.> Important: The `type` query parameter does not directly relate to the `type` attribute.To retrieve only ***distribution*** images, include the `type` query parameter set to distribution, `/v2/images?type=distribution`.To retrieve only ***application*** images, include the `type` query parameter set to application, `/v2/images?type=application`.**User Images**To retrieve only the private images of a user, include the `private` query parameter set to true, `/v2/images?private=true`.**Tags**To list all images assigned to a specific tag, include the `tag_name` query parameter set to the name of the tag in your GET request. For example, `/v2/images?tag_name=$TAG_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsImagesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsImagesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the images available on your account, send a GET request to /v2/images.## Filtering Results-----It's possible to request filtered results by including certain query parameters.**Image Type**Either 1-Click Application or OS Distribution images can be filtered by using the `type` query parameter.> Important: The `type` query parameter does not directly relate to the `type` attribute.To retrieve only ***distribution*** images, include the `type` query parameter set to distribution, `/v2/images?type=distribution`.To retrieve only ***application*** images, include the `type` query parameter set to application, `/v2/images?type=application`.**User Images**To retrieve only the private images of a user, include the `private` query parameter set to true, `/v2/images?private=true`.**Tags**To list all images assigned to a specific tag, include the `tag_name` query parameter set to the name of the tag in your GET request. For example, `/v2/images?tag_name=$TAG_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsImagesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new custom image, send a POST request to /v2/images.The body must contain a url attribute pointing to a Linux virtual machineimage to be imported into DigitalOcean.The image must be in the raw, qcow2, vhdx, vdi, or vmdk format.It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsImagesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsImagesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new custom image, send a POST request to /v2/images.The body must contain a url attribute pointing to a Linux virtual machineimage to be imported into DigitalOcean.The image must be in the raw, qcow2, vhdx, vdi, or vmdk format.It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsImagesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the images available on your account, send a GET request to /v2/images.## Filtering Results-----It's possible to request filtered results by including certain query parameters.**Image Type**Either 1-Click Application or OS Distribution images can be filtered by using the `type` query parameter.> Important: The `type` query parameter does not directly relate to the `type` attribute.To retrieve only ***distribution*** images, include the `type` query parameter set to distribution, `/v2/images?type=distribution`.To retrieve only ***application*** images, include the `type` query parameter set to application, `/v2/images?type=application`.**User Images**To retrieve only the private images of a user, include the `private` query parameter set to true, `/v2/images?private=true`.**Tags**To list all images assigned to a specific tag, include the `tag_name` query parameter set to the name of the tag in your GET request. For example, `/v2/images?tag_name=$TAG_NAME`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new custom image, send a POST request to /v2/images.The body must contain a url attribute pointing to a Linux virtual machineimage to be imported into DigitalOcean.The image must be in the raw, qcow2, vhdx, vdi, or vmdk format.It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Image_new_custom body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the images available on your account, send a GET request to /v2/images.## Filtering Results-----It's possible to request filtered results by including certain query parameters.**Image Type**Either 1-Click Application or OS Distribution images can be filtered by using the `type` query parameter.> Important: The `type` query parameter does not directly relate to the `type` attribute.To retrieve only ***distribution*** images, include the `type` query parameter set to distribution, `/v2/images?type=distribution`.To retrieve only ***application*** images, include the `type` query parameter set to application, `/v2/images?type=application`.**User Images**To retrieve only the private images of a user, include the `private` query parameter set to true, `/v2/images?private=true`.**Tags**To list all images assigned to a specific tag, include the `tag_name` query parameter set to the name of the tag in your GET request. For example, `/v2/images?tag_name=$TAG_NAME`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ImagesRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// Used to filter only user images. + [QueryParameter("private")] + public bool? Private { get; set; } + /// Used to filter images by a specific tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag_name")] + public string? TagName { get; set; } +#nullable restore +#else + [QueryParameter("tag_name")] + public string TagName { get; set; } +#endif + /// Filters results based on image type which can be either `application` or `distribution`. + [Obsolete("This property is deprecated, use TypeAsGetTypeQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + /// Filters results based on image type which can be either `application` or `distribution`. + [QueryParameter("type")] + public global::InfinityFlow.DigitalOcean.Client.V2.Images.GetTypeQueryParameterType? TypeAsGetTypeQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ImagesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ImagesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesResponse.cs new file mode 100644 index 0000000..32d5439 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/ImagesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images +{ + [Obsolete("This class is obsolete. Use ImagesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ImagesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsGetResponse.cs new file mode 100644 index 0000000..5858f97 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ActionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..7a30328 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,283 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions +{ + /// + /// Builds and executes requests for operations under \v2\images\{image_id}\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.images.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item.WithAction_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.images.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item.WithAction_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images/{image_id}/actions", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images/{image_id}/actions", rawUrl) + { + } + /// + /// To retrieve all actions that have been executed on an image, send a GET request to `/v2/images/$IMAGE_ID/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsActionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsActionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on an image, send a GET request to `/v2/images/$IMAGE_ID/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsActionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// The following actions are available on an Image.## Convert an Image to a SnapshotTo convert an image, for example, a backup to a snapshot, send a POST requestto `/v2/images/$IMAGE_ID/actions`. Set the `type` attribute to `convert`.## Transfer an ImageTo transfer an image to another region, send a POST request to`/v2/images/$IMAGE_ID/actions`. Set the `type` attribute to `transfer` and set`region` attribute to the slug identifier of the region you wish to transferto. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on an image, send a GET request to `/v2/images/$IMAGE_ID/actions`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The following actions are available on an Image.## Convert an Image to a SnapshotTo convert an image, for example, a backup to a snapshot, send a POST requestto `/v2/images/$IMAGE_ID/actions`. Set the `type` attribute to `convert`.## Transfer an ImageTo transfer an image to another region, send a POST request to`/v2/images/$IMAGE_ID/actions`. Set the `type` attribute to `transfer` and set`region` attribute to the slug identifier of the region you wish to transferto. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Image_action_base? ImageActionBase { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Image_action_base ImageActionBase { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Image_action_transfer? ImageActionTransfer { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Image_action_transfer ImageActionTransfer { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody(); + result.ImageActionBase = new global::InfinityFlow.DigitalOcean.Client.Models.Image_action_base(); + result.ImageActionTransfer = new global::InfinityFlow.DigitalOcean.Client.Models.Image_action_transfer(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(ImageActionBase != null || ImageActionTransfer != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(ImageActionBase, ImageActionTransfer); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, ImageActionBase, ImageActionTransfer); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsResponse.cs new file mode 100644 index 0000000..cd486ff --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions +{ + [Obsolete("This class is obsolete. Use ActionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/Item/WithAction_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/Item/WithAction_ItemRequestBuilder.cs new file mode 100644 index 0000000..a76d68d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/Actions/Item/WithAction_ItemRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item +{ + /// + /// Builds and executes requests for operations under \v2\images\{image_id}\actions\{action_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images/{image_id}/actions/{action_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images/{image_id}/actions/{action_id}", rawUrl) + { + } + /// + /// To retrieve the status of an image action, send a GET request to `/v2/images/$IMAGE_ID/actions/$IMAGE_ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of an image action, send a GET request to `/v2/images/$IMAGE_ID/actions/$IMAGE_ACTION_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item.WithAction_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.Item.WithAction_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_GetResponse.cs new file mode 100644 index 0000000..27213d5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithImage_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Image? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Image Image { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithImage_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Image.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("image", Image); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_ItemRequestBuilder.cs new file mode 100644 index 0000000..4c656a8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_ItemRequestBuilder.cs @@ -0,0 +1,297 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item +{ + /// + /// Builds and executes requests for operations under \v2\images\{image_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithImage_ItemRequestBuilder : BaseRequestBuilder + { + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImage_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images/{image_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImage_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/images/{image_id}", rawUrl) + { + } + /// + /// To delete a snapshot or custom image, send a `DELETE` request to `/v2/images/$IMAGE_ID`. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve information about an image, send a `GET` request to`/v2/images/$IDENTIFIER`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithImage_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithImage_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve information about an image, send a `GET` request to`/v2/images/$IDENTIFIER`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithImage_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an image, send a `PUT` request to `/v2/images/$IMAGE_ID`.Set the `name` attribute to the new value you would like to use.For custom images, the `description` and `distribution` attributes may also be updated. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithImage_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithImage_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update an image, send a `PUT` request to `/v2/images/$IMAGE_ID`.Set the `name` attribute to the new value you would like to use.For custom images, the `description` and `distribution` attributes may also be updated. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithImage_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Image_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a snapshot or custom image, send a `DELETE` request to `/v2/images/$IMAGE_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To retrieve information about an image, send a `GET` request to`/v2/images/$IDENTIFIER`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update an image, send a `PUT` request to `/v2/images/$IMAGE_ID`.Set the `name` attribute to the new value you would like to use.For custom images, the `description` and `distribution` attributes may also be updated. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Image_update body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Image_update body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithImage_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithImage_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithImage_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_PutResponse.cs new file mode 100644 index 0000000..7c35529 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithImage_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Image? Image { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Image Image { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithImage_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "image", n => { Image = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Image.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("image", Image); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_Response.cs new file mode 100644 index 0000000..81e4217 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Images/Item/WithImage_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Images.Item +{ + [Obsolete("This class is obsolete. Use WithImage_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithImage_Response : global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Images.Item.WithImage_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersGetResponse.cs new file mode 100644 index 0000000..516d7d6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ClustersGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kubernetes_clusters property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? KubernetesClusters { get; set; } +#nullable restore +#else + public List KubernetesClusters { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ClustersGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kubernetes_clusters", n => { KubernetesClusters = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Cluster.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("kubernetes_clusters", KubernetesClusters); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersPostResponse.cs new file mode 100644 index 0000000..cace0c5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ClustersPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kubernetes_cluster property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster? KubernetesCluster { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster KubernetesCluster { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ClustersPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kubernetes_cluster", n => { KubernetesCluster = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Cluster.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("kubernetes_cluster", KubernetesCluster); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersRequestBuilder.cs new file mode 100644 index 0000000..08b18bb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersRequestBuilder.cs @@ -0,0 +1,265 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClustersRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.kubernetes.clusters.item collection + /// A unique ID that can be used to reference a Kubernetes cluster. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("cluster_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.kubernetes.clusters.item collection + /// A unique ID that can be used to reference a Kubernetes cluster. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("cluster_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ClustersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ClustersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the Kubernetes clusters on your account, send a GET requestto `/v2/kubernetes/clusters`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsClustersGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsClustersGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the Kubernetes clusters on your account, send a GET requestto `/v2/kubernetes/clusters`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsClustersGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new Kubernetes cluster, send a POST request to`/v2/kubernetes/clusters`. The request must contain at least one node poolwith at least one worker.The request may contain a maintenance window policy describing a time periodwhen disruptive maintenance tasks may be carried out. Omitting the policyimplies that a window will be chosen automatically. See[here](https://docs.digitalocean.com/products/kubernetes/how-to/upgrade-cluster/)for details. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsClustersPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsClustersPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new Kubernetes cluster, send a POST request to`/v2/kubernetes/clusters`. The request must contain at least one node poolwith at least one worker.The request may contain a maintenance window policy describing a time periodwhen disruptive maintenance tasks may be carried out. Omitting the policyimplies that a window will be chosen automatically. See[here](https://docs.digitalocean.com/products/kubernetes/how-to/upgrade-cluster/)for details. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsClustersPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the Kubernetes clusters on your account, send a GET requestto `/v2/kubernetes/clusters`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new Kubernetes cluster, send a POST request to`/v2/kubernetes/clusters`. The request must contain at least one node poolwith at least one worker.The request may contain a maintenance window policy describing a time periodwhen disruptive maintenance tasks may be carried out. Omitting the policyimplies that a window will be chosen automatically. See[here](https://docs.digitalocean.com/products/kubernetes/how-to/upgrade-cluster/)for details. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the Kubernetes clusters on your account, send a GET requestto `/v2/kubernetes/clusters`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClustersRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClustersRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClustersRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersResponse.cs new file mode 100644 index 0000000..77e720a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/ClustersResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters +{ + [Obsolete("This class is obsolete. Use ClustersGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ClustersResponse : global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintPostResponse.cs new file mode 100644 index 0000000..057742f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintPostResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ClusterlintPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// ID of the clusterlint run that can be used later to fetch the diagnostics. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunId { get; set; } +#nullable restore +#else + public string RunId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ClusterlintPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "run_id", n => { RunId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("run_id", RunId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintRequestBuilder.cs new file mode 100644 index 0000000..62ed77e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintRequestBuilder.cs @@ -0,0 +1,212 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\clusterlint + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClusterlintRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ClusterlintRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/clusterlint{?run_id*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ClusterlintRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/clusterlint{?run_id*}", rawUrl) + { + } + /// + /// To request clusterlint diagnostics for your cluster, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint`. If the `run_id` queryparameter is provided, then the diagnostics for the specific run is fetched.By default, the latest results are shown.To find out how to address clusterlint feedback, please refer to[the clusterlint check documentation](https://github.com/digitalocean/clusterlint/blob/master/checks.md). + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_results.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Clusterlint helps operators conform to Kubernetes best practices aroundresources, security and reliability to avoid common problems while operatingor upgrading the clusters.To request a clusterlint run on your cluster, send a POST request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint`. This will run allchecks present in the `doks` group by default, if a request body is notspecified. Optionally specify the below attributes.For information about the available checks, please refer to[the clusterlint check documentation](https://github.com/digitalocean/clusterlint/blob/master/checks.md). + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsClusterlintPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsClusterlintPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Clusterlint helps operators conform to Kubernetes best practices aroundresources, security and reliability to avoid common problems while operatingor upgrading the clusters.To request a clusterlint run on your cluster, send a POST request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint`. This will run allchecks present in the `doks` group by default, if a request body is notspecified. Optionally specify the below attributes.For information about the available checks, please refer to[the clusterlint check documentation](https://github.com/digitalocean/clusterlint/blob/master/checks.md). + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsClusterlintPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To request clusterlint diagnostics for your cluster, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint`. If the `run_id` queryparameter is provided, then the diagnostics for the specific run is fetched.By default, the latest results are shown.To find out how to address clusterlint feedback, please refer to[the clusterlint check documentation](https://github.com/digitalocean/clusterlint/blob/master/checks.md). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Clusterlint helps operators conform to Kubernetes best practices aroundresources, security and reliability to avoid common problems while operatingor upgrading the clusters.To request a clusterlint run on your cluster, send a POST request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint`. This will run allchecks present in the `doks` group by default, if a request body is notspecified. Optionally specify the below attributes.For information about the available checks, please refer to[the clusterlint check documentation](https://github.com/digitalocean/clusterlint/blob/master/checks.md). + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Clusterlint_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To request clusterlint diagnostics for your cluster, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint`. If the `run_id` queryparameter is provided, then the diagnostics for the specific run is fetched.By default, the latest results are shown.To find out how to address clusterlint feedback, please refer to[the clusterlint check documentation](https://github.com/digitalocean/clusterlint/blob/master/checks.md). + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClusterlintRequestBuilderGetQueryParameters + { + /// Specifies the clusterlint run whose results will be retrieved. + [QueryParameter("run_id")] + public Guid? RunId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClusterlintRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ClusterlintRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintResponse.cs new file mode 100644 index 0000000..9f3e9cb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Clusterlint/ClusterlintResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint +{ + [Obsolete("This class is obsolete. Use ClusterlintPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ClusterlintResponse : global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Credentials/CredentialsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Credentials/CredentialsRequestBuilder.cs new file mode 100644 index 0000000..fd51a8c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Credentials/CredentialsRequestBuilder.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Credentials +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\credentials + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CredentialsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CredentialsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/credentials{?expiry_seconds*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CredentialsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/credentials{?expiry_seconds*}", rawUrl) + { + } + /// + /// This endpoint returns a JSON object . It can be used to programmaticallyconstruct Kubernetes clients which cannot parse kubeconfig files.The resulting JSON object contains token-based authentication for clusterssupporting it, and certificate-based authentication otherwise. For a list ofsupported versions and more information, see "[How to Connect to a DigitalOceanKubernetes Cluster](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/)".To retrieve credentials for accessing a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials`.Clusters supporting token-based authentication may define an expiration bypassing a duration in seconds as a query parameter to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials?expiry_seconds=$DURATION_IN_SECONDS`.If not set or 0, then the token will have a 7 day expiry. The query parameterhas no impact in certificate-based authentication. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Credentials.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This endpoint returns a JSON object . It can be used to programmaticallyconstruct Kubernetes clients which cannot parse kubeconfig files.The resulting JSON object contains token-based authentication for clusterssupporting it, and certificate-based authentication otherwise. For a list ofsupported versions and more information, see "[How to Connect to a DigitalOceanKubernetes Cluster](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/)".To retrieve credentials for accessing a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials`.Clusters supporting token-based authentication may define an expiration bypassing a duration in seconds as a query parameter to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials?expiry_seconds=$DURATION_IN_SECONDS`.If not set or 0, then the token will have a 7 day expiry. The query parameterhas no impact in certificate-based authentication. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Credentials.CredentialsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Credentials.CredentialsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// This endpoint returns a JSON object . It can be used to programmaticallyconstruct Kubernetes clients which cannot parse kubeconfig files.The resulting JSON object contains token-based authentication for clusterssupporting it, and certificate-based authentication otherwise. For a list ofsupported versions and more information, see "[How to Connect to a DigitalOceanKubernetes Cluster](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/)".To retrieve credentials for accessing a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials`.Clusters supporting token-based authentication may define an expiration bypassing a duration in seconds as a query parameter to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials?expiry_seconds=$DURATION_IN_SECONDS`.If not set or 0, then the token will have a 7 day expiry. The query parameterhas no impact in certificate-based authentication. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CredentialsRequestBuilderGetQueryParameters + { + /// The duration in seconds that the returned Kubernetes credentials will be valid. If not set or 0, the credentials will have a 7 day expiry. + [QueryParameter("expiry_seconds")] + public int? ExpirySeconds { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CredentialsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Dangerous/DangerousRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Dangerous/DangerousRequestBuilder.cs new file mode 100644 index 0000000..4524100 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Dangerous/DangerousRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Dangerous +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\destroy_with_associated_resources\dangerous + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DangerousRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DangerousRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources/dangerous", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DangerousRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources/dangerous", rawUrl) + { + } + /// + /// To delete a Kubernetes cluster with all of its associated resources, send aDELETE request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/dangerous`.A 204 status code with no body will be returned in response to a successful request. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a Kubernetes cluster with all of its associated resources, send aDELETE request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/dangerous`.A 204 status code with no body will be returned in response to a successful request. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DangerousRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesRequestBuilder.cs new file mode 100644 index 0000000..269729c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Destroy_with_associated_resourcesRequestBuilder.cs @@ -0,0 +1,117 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Dangerous; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Selective; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\destroy_with_associated_resources + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Destroy_with_associated_resourcesRequestBuilder : BaseRequestBuilder + { + /// The dangerous property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder Dangerous + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Dangerous.DangerousRequestBuilder(PathParameters, RequestAdapter); + } + /// The selective property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder Selective + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Destroy_with_associated_resourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Destroy_with_associated_resourcesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources", rawUrl) + { + } + /// + /// To list the associated billable resources that can be destroyed along with a cluster, send a GET request to the `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources` endpoint. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Associated_kubernetes_resources.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list the associated billable resources that can be destroyed along with a cluster, send a GET request to the `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources` endpoint. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Destroy_with_associated_resourcesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Selective/SelectiveRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Selective/SelectiveRequestBuilder.cs new file mode 100644 index 0000000..83fb94c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Destroy_with_associated_resources/Selective/SelectiveRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Selective +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\destroy_with_associated_resources\selective + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SelectiveRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SelectiveRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources/selective", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SelectiveRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources/selective", rawUrl) + { + } + /// + /// To delete a Kubernetes cluster along with a subset of its associated resources,send a DELETE request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective`.The JSON body of the request should include `load_balancers`, `volumes`, or`volume_snapshots` keys each set to an array of IDs for the associatedresources to be destroyed.The IDs can be found by querying the cluster's associated resources endpoint.Any associated resource not included in the request will remain and continueto accrue changes on your account. + /// + /// An object containing the IDs of resources to be destroyed along with their associated with a Kubernetes cluster. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destroy_associated_kubernetes_resources body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destroy_associated_kubernetes_resources body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a Kubernetes cluster along with a subset of its associated resources,send a DELETE request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective`.The JSON body of the request should include `load_balancers`, `volumes`, or`volume_snapshots` keys each set to an array of IDs for the associatedresources to be destroyed.The IDs can be found by querying the cluster's associated resources endpoint.Any associated resource not included in the request will remain and continueto accrue changes on your account. + /// + /// A + /// An object containing the IDs of resources to be destroyed along with their associated with a Kubernetes cluster. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Destroy_associated_kubernetes_resources body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Destroy_associated_kubernetes_resources body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Selective.SelectiveRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SelectiveRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Kubeconfig/KubeconfigRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Kubeconfig/KubeconfigRequestBuilder.cs new file mode 100644 index 0000000..79a7131 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Kubeconfig/KubeconfigRequestBuilder.cs @@ -0,0 +1,115 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Kubeconfig +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\kubeconfig + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KubeconfigRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public KubeconfigRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/kubeconfig{?expiry_seconds*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public KubeconfigRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/kubeconfig{?expiry_seconds*}", rawUrl) + { + } + /// + /// This endpoint returns a kubeconfig file in YAML format. It can be used toconnect to and administer the cluster using the Kubernetes command line tool,`kubectl`, or other programs supporting kubeconfig files (e.g., client libraries).The resulting kubeconfig file uses token-based authentication for clusterssupporting it, and certificate-based authentication otherwise. For a list ofsupported versions and more information, see "[How to Connect to a DigitalOceanKubernetes Cluster](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/)".To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig`.Clusters supporting token-based authentication may define an expiration bypassing a duration in seconds as a query parameter to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig?expiry_seconds=$DURATION_IN_SECONDS`.If not set or 0, then the token will have a 7 day expiry. The query parameterhas no impact in certificate-based authentication. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This endpoint returns a kubeconfig file in YAML format. It can be used toconnect to and administer the cluster using the Kubernetes command line tool,`kubectl`, or other programs supporting kubeconfig files (e.g., client libraries).The resulting kubeconfig file uses token-based authentication for clusterssupporting it, and certificate-based authentication otherwise. For a list ofsupported versions and more information, see "[How to Connect to a DigitalOceanKubernetes Cluster](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/)".To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig`.Clusters supporting token-based authentication may define an expiration bypassing a duration in seconds as a query parameter to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig?expiry_seconds=$DURATION_IN_SECONDS`.If not set or 0, then the token will have a 7 day expiry. The query parameterhas no impact in certificate-based authentication. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/yaml, application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Kubeconfig.KubeconfigRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Kubeconfig.KubeconfigRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// This endpoint returns a kubeconfig file in YAML format. It can be used toconnect to and administer the cluster using the Kubernetes command line tool,`kubectl`, or other programs supporting kubeconfig files (e.g., client libraries).The resulting kubeconfig file uses token-based authentication for clusterssupporting it, and certificate-based authentication otherwise. For a list ofsupported versions and more information, see "[How to Connect to a DigitalOceanKubernetes Cluster](https://docs.digitalocean.com/products/kubernetes/how-to/connect-to-cluster/)".To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig`.Clusters supporting token-based authentication may define an expiration bypassing a duration in seconds as a query parameter to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig?expiry_seconds=$DURATION_IN_SECONDS`.If not set or 0, then the token will have a 7 day expiry. The query parameterhas no impact in certificate-based authentication. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KubeconfigRequestBuilderGetQueryParameters + { + /// The duration in seconds that the returned Kubernetes credentials will be valid. If not set or 0, the credentials will have a 7 day expiry. + [QueryParameter("expiry_seconds")] + public int? ExpirySeconds { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KubeconfigRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Nodes/Item/WithNode_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Nodes/Item/WithNode_ItemRequestBuilder.cs new file mode 100644 index 0000000..861ae81 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Nodes/Item/WithNode_ItemRequestBuilder.cs @@ -0,0 +1,117 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\node_pools\{node_pool_id}\nodes\{node_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNode_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNode_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}/nodes/{node_id}{?replace*,skip_drain*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNode_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}/nodes/{node_id}{?replace*,skip_drain*}", rawUrl) + { + } + /// + /// To delete a single node in a pool, send a DELETE request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID`.Appending the `skip_drain=1` query parameter to the request causes nodedraining to be skipped. Omitting the query parameter or setting its value to`0` carries out draining prior to deletion.Appending the `replace=1` query parameter to the request causes the node tobe replaced by a new one after deletion. Omitting the query parameter orsetting its value to `0` deletes without replacement. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a single node in a pool, send a DELETE request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID`.Appending the `skip_drain=1` query parameter to the request causes nodedraining to be skipped. Omitting the query parameter or setting its value to`0` carries out draining prior to deletion.Appending the `replace=1` query parameter to the request causes the node tobe replaced by a new one after deletion. Omitting the query parameter orsetting its value to `0` deletes without replacement. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item.WithNode_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item.WithNode_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To delete a single node in a pool, send a DELETE request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID`.Appending the `skip_drain=1` query parameter to the request causes nodedraining to be skipped. Omitting the query parameter or setting its value to`0` carries out draining prior to deletion.Appending the `replace=1` query parameter to the request causes the node tobe replaced by a new one after deletion. Omitting the query parameter orsetting its value to `0` deletes without replacement. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNode_ItemRequestBuilderDeleteQueryParameters + { + /// Specifies whether or not to replace a node after it has been deleted. Setting it to `1` causes the node to be replaced by a new one after deletion. Omitting the query parameter or setting its value to `0` deletes without replacement. + [QueryParameter("replace")] + public int? Replace { get; set; } + /// Specifies whether or not to drain workloads from a node before it is deleted. Setting it to `1` causes node draining to be skipped. Omitting the query parameter or setting its value to `0` carries out draining prior to deletion. + [QueryParameter("skip_drain")] + public int? SkipDrain { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNode_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Nodes/NodesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Nodes/NodesRequestBuilder.cs new file mode 100644 index 0000000..de1aeaa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Nodes/NodesRequestBuilder.cs @@ -0,0 +1,61 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\node_pools\{node_pool_id}\nodes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class NodesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.kubernetes.clusters.item.node_pools.item.nodes.item collection + /// A unique ID that can be used to reference a node in a Kubernetes node pool. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item.WithNode_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("node_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item.WithNode_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.kubernetes.clusters.item.node_pools.item.nodes.item collection + /// A unique ID that can be used to reference a node in a Kubernetes node pool. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item.WithNode_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("node_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.Item.WithNode_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NodesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}/nodes", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NodesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}/nodes", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Recycle/RecyclePostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Recycle/RecyclePostRequestBody.cs new file mode 100644 index 0000000..889a57f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Recycle/RecyclePostRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RecyclePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The nodes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Nodes { get; set; } +#nullable restore +#else + public List Nodes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RecyclePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecyclePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecyclePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "nodes", n => { Nodes = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("nodes", Nodes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Recycle/RecycleRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Recycle/RecycleRequestBuilder.cs new file mode 100644 index 0000000..bf77b50 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/Recycle/RecycleRequestBuilder.cs @@ -0,0 +1,112 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\node_pools\{node_pool_id}\recycle + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RecycleRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RecycleRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}/recycle", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RecycleRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}/recycle", rawUrl) + { + } + /// + /// The endpoint has been deprecated. Please use the DELETE`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID`method instead. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecyclePostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecyclePostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// The endpoint has been deprecated. Please use the DELETE`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID`method instead. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecyclePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecyclePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + [Obsolete("")] + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecycleRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecycleRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RecycleRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_GetResponse.cs new file mode 100644 index 0000000..83e02b0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithNode_pool_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The node_pool property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool? NodePool { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool NodePool { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithNode_pool_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "node_pool", n => { NodePool = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("node_pool", NodePool); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_ItemRequestBuilder.cs new file mode 100644 index 0000000..5cd5023 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_ItemRequestBuilder.cs @@ -0,0 +1,303 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\node_pools\{node_pool_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNode_pool_ItemRequestBuilder : BaseRequestBuilder + { + /// The nodes property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.NodesRequestBuilder Nodes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Nodes.NodesRequestBuilder(PathParameters, RequestAdapter); + } + /// The recycle property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecycleRequestBuilder Recycle + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.Recycle.RecycleRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNode_pool_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNode_pool_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools/{node_pool_id}", rawUrl) + { + } + /// + /// To delete a node pool, send a DELETE request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID`.A 204 status code with no body will be returned in response to a successfulrequest. Nodes in the pool will subsequently be drained and deleted. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a specific node pool in a Kubernetes cluster, senda GET request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithNode_pool_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithNode_pool_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a specific node pool in a Kubernetes cluster, senda GET request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithNode_pool_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of a node pool, edit the tags applied to it, or adjust itsnumber of nodes, send a PUT request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID` with thefollowing attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithNode_pool_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithNode_pool_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of a node pool, edit the tags applied to it, or adjust itsnumber of nodes, send a PUT request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID` with thefollowing attributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithNode_pool_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a node pool, send a DELETE request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID`.A 204 status code with no body will be returned in response to a successfulrequest. Nodes in the pool will subsequently be drained and deleted. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about a specific node pool in a Kubernetes cluster, senda GET request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the name of a node pool, edit the tags applied to it, or adjust itsnumber of nodes, send a PUT request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID` with thefollowing attributes. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool_update body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNode_pool_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNode_pool_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithNode_pool_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_PutResponse.cs new file mode 100644 index 0000000..aeb0f84 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithNode_pool_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The node_pool property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool? NodePool { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool NodePool { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithNode_pool_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "node_pool", n => { NodePool = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("node_pool", NodePool); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_Response.cs new file mode 100644 index 0000000..a17985f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Item/WithNode_pool_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item +{ + [Obsolete("This class is obsolete. Use WithNode_pool_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithNode_pool_Response : global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsGetResponse.cs new file mode 100644 index 0000000..c18bfbf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Node_poolsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The node_pools property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NodePools { get; set; } +#nullable restore +#else + public List NodePools { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Node_poolsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "node_pools", n => { NodePools = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("node_pools", NodePools); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsPostResponse.cs new file mode 100644 index 0000000..f70d026 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Node_poolsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The node_pool property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool? NodePool { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool NodePool { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Node_poolsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "node_pool", n => { NodePool = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("node_pool", NodePool); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsRequestBuilder.cs new file mode 100644 index 0000000..c1fb40a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsRequestBuilder.cs @@ -0,0 +1,260 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\node_pools + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Node_poolsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.kubernetes.clusters.item.node_pools.item collection + /// A unique ID that can be used to reference a Kubernetes node pool. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("node_pool_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.kubernetes.clusters.item.node_pools.item collection + /// A unique ID that can be used to reference a Kubernetes node pool. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("node_pool_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Item.WithNode_pool_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Node_poolsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Node_poolsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/node_pools", rawUrl) + { + } + /// + /// To list all of the node pools in a Kubernetes clusters, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsNode_poolsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsNode_poolsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the node pools in a Kubernetes clusters, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsNode_poolsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add an additional node pool to a Kubernetes clusters, send a POST requestto `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools` with the followingattributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsNode_poolsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsNode_poolsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add an additional node pool to a Kubernetes clusters, send a POST requestto `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools` with the followingattributes. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsNode_poolsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the node pools in a Kubernetes clusters, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To add an additional node pool to a Kubernetes clusters, send a POST requestto `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools` with the followingattributes. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_node_pool body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Node_poolsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Node_poolsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsResponse.cs new file mode 100644 index 0000000..a150465 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Node_pools/Node_poolsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools +{ + [Obsolete("This class is obsolete. Use Node_poolsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Node_poolsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrade/UpgradePostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrade/UpgradePostRequestBody.cs new file mode 100644 index 0000000..3631d69 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrade/UpgradePostRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class UpgradePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The slug identifier for the version of Kubernetes that the cluster will be upgraded to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpgradePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("version", Version); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrade/UpgradeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrade/UpgradeRequestBuilder.cs new file mode 100644 index 0000000..af729d1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrade/UpgradeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\upgrade + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UpgradeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpgradeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/upgrade", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpgradeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/upgrade", rawUrl) + { + } + /// + /// To immediately upgrade a Kubernetes cluster to a newer patch release ofKubernetes, send a POST request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrade`.The body of the request must specify a version attribute.Available upgrade versions for a cluster can be fetched from`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades`. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradePostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradePostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To immediately upgrade a Kubernetes cluster to a newer patch release ofKubernetes, send a POST request to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrade`.The body of the request must specify a version attribute.Available upgrade versions for a cluster can be fetched from`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UpgradeRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesGetResponse.cs new file mode 100644 index 0000000..c14a697 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class UpgradesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The available_upgrade_versions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AvailableUpgradeVersions { get; set; } +#nullable restore +#else + public List AvailableUpgradeVersions { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpgradesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "available_upgrade_versions", n => { AvailableUpgradeVersions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_version.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("available_upgrade_versions", AvailableUpgradeVersions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesRequestBuilder.cs new file mode 100644 index 0000000..69af474 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\upgrades + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UpgradesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpgradesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/upgrades", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpgradesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/upgrades", rawUrl) + { + } + /// + /// To determine whether a cluster can be upgraded, and the versions to which itcan be upgraded, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsUpgradesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsUpgradesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To determine whether a cluster can be upgraded, and the versions to which itcan be upgraded, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsUpgradesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To determine whether a cluster can be upgraded, and the versions to which itcan be upgraded, send a GET request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UpgradesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesResponse.cs new file mode 100644 index 0000000..e2d430b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/Upgrades/UpgradesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades +{ + [Obsolete("This class is obsolete. Use UpgradesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class UpgradesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/User/UserRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/User/UserRequestBuilder.cs new file mode 100644 index 0000000..e6d70ac --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/User/UserRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.User +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id}\user + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UserRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/user", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UserRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}/user", rawUrl) + { + } + /// + /// To show information the user associated with a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/user`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.User.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information the user associated with a Kubernetes cluster, send a GETrequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID/user`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.User.UserRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.User.UserRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UserRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_GetResponse.cs new file mode 100644 index 0000000..097e61b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCluster_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kubernetes_cluster property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster? KubernetesCluster { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster KubernetesCluster { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithCluster_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kubernetes_cluster", n => { KubernetesCluster = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Cluster.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("kubernetes_cluster", KubernetesCluster); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_ItemRequestBuilder.cs new file mode 100644 index 0000000..67cb926 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_ItemRequestBuilder.cs @@ -0,0 +1,339 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Credentials; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Kubeconfig; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.User; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\clusters\{cluster_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCluster_ItemRequestBuilder : BaseRequestBuilder + { + /// The clusterlint property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintRequestBuilder Clusterlint + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Clusterlint.ClusterlintRequestBuilder(PathParameters, RequestAdapter); + } + /// The credentials property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Credentials.CredentialsRequestBuilder Credentials + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Credentials.CredentialsRequestBuilder(PathParameters, RequestAdapter); + } + /// The destroy_with_associated_resources property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder Destroy_with_associated_resources + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Destroy_with_associated_resources.Destroy_with_associated_resourcesRequestBuilder(PathParameters, RequestAdapter); + } + /// The kubeconfig property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Kubeconfig.KubeconfigRequestBuilder Kubeconfig + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Kubeconfig.KubeconfigRequestBuilder(PathParameters, RequestAdapter); + } + /// The node_pools property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsRequestBuilder Node_pools + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Node_pools.Node_poolsRequestBuilder(PathParameters, RequestAdapter); + } + /// The upgrade property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradeRequestBuilder Upgrade + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrade.UpgradeRequestBuilder(PathParameters, RequestAdapter); + } + /// The upgrades property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesRequestBuilder Upgrades + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.Upgrades.UpgradesRequestBuilder(PathParameters, RequestAdapter); + } + /// The user property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.User.UserRequestBuilder User + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.User.UserRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCluster_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCluster_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/clusters/{cluster_id}", rawUrl) + { + } + /// + /// To delete a Kubernetes cluster and all services deployed to it, send a DELETErequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID`.A 204 status code with no body will be returned in response to a successfulrequest. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing Kubernetes cluster, send a GET requestto `/v2/kubernetes/clusters/$K8S_CLUSTER_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithCluster_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithCluster_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing Kubernetes cluster, send a GET requestto `/v2/kubernetes/clusters/$K8S_CLUSTER_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithCluster_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a Kubernetes cluster, send a PUT request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID` and specify one or more of theattributes below. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithCluster_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithCluster_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a Kubernetes cluster, send a PUT request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID` and specify one or more of theattributes below. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithCluster_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a Kubernetes cluster and all services deployed to it, send a DELETErequest to `/v2/kubernetes/clusters/$K8S_CLUSTER_ID`.A 204 status code with no body will be returned in response to a successfulrequest. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing Kubernetes cluster, send a GET requestto `/v2/kubernetes/clusters/$K8S_CLUSTER_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update a Kubernetes cluster, send a PUT request to`/v2/kubernetes/clusters/$K8S_CLUSTER_ID` and specify one or more of theattributes below. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_update body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCluster_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCluster_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCluster_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_PutResponse.cs new file mode 100644 index 0000000..e27db55 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCluster_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The kubernetes_cluster property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster? KubernetesCluster { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Cluster KubernetesCluster { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithCluster_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "kubernetes_cluster", n => { KubernetesCluster = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Cluster.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("kubernetes_cluster", KubernetesCluster); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_Response.cs new file mode 100644 index 0000000..b0a78f4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Clusters/Item/WithCluster_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item +{ + [Obsolete("This class is obsolete. Use WithCluster_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCluster_Response : global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.Item.WithCluster_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/KubernetesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/KubernetesRequestBuilder.cs new file mode 100644 index 0000000..f5de21d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/KubernetesRequestBuilder.cs @@ -0,0 +1,53 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Options; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Registry; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KubernetesRequestBuilder : BaseRequestBuilder + { + /// The clusters property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersRequestBuilder Clusters + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Clusters.ClustersRequestBuilder(PathParameters, RequestAdapter); + } + /// The optionsPath property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Options.OptionsRequestBuilder OptionsPath + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Options.OptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The registry property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Registry.RegistryRequestBuilder Registry + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Registry.RegistryRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public KubernetesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public KubernetesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Options/OptionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Options/OptionsRequestBuilder.cs new file mode 100644 index 0000000..7bd49bd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Options/OptionsRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Options +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\options + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OptionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/options", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/options", rawUrl) + { + } + /// + /// To list the versions of Kubernetes available for use, the regions that support Kubernetes, and the available node sizes, send a GET request to `/v2/kubernetes/options`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Kubernetes_options.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list the versions of Kubernetes available for use, the regions that support Kubernetes, and the available node sizes, send a GET request to `/v2/kubernetes/options`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Options.OptionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Options.OptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OptionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Registry/RegistryRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Registry/RegistryRequestBuilder.cs new file mode 100644 index 0000000..1995b00 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Kubernetes/Registry/RegistryRequestBuilder.cs @@ -0,0 +1,167 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Registry +{ + /// + /// Builds and executes requests for operations under \v2\kubernetes\registry + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegistryRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RegistryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/registry", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RegistryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/kubernetes/registry", rawUrl) + { + } + /// + /// To remove the container registry from Kubernetes clusters, send a DELETE request to `/v2/kubernetes/registry`. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To integrate the container registry with Kubernetes clusters, send a POST request to `/v2/kubernetes/registry`. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To remove the container registry from Kubernetes clusters, send a DELETE request to `/v2/kubernetes/registry`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To integrate the container registry with Kubernetes clusters, send a POST request to `/v2/kubernetes/registry`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Cluster_registries body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Registry.RegistryRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.Registry.RegistryRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegistryRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegistryRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsDeleteRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsDeleteRequestBody.cs new file mode 100644 index 0000000..2af47e1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsDeleteRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsDeleteRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array containing the IDs of the Droplets assigned to the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; set; } +#nullable restore +#else + public List DropletIds { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DropletsDeleteRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsDeleteRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsDeleteRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("droplet_ids", DropletIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsPostRequestBody.cs new file mode 100644 index 0000000..5638608 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsPostRequestBody.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DropletsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array containing the IDs of the Droplets assigned to the load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DropletIds { get; set; } +#nullable restore +#else + public List DropletIds { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DropletsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "droplet_ids", n => { DropletIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("droplet_ids", DropletIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsRequestBuilder.cs new file mode 100644 index 0000000..e6a343a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Droplets/DropletsRequestBuilder.cs @@ -0,0 +1,171 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets +{ + /// + /// Builds and executes requests for operations under \v2\load_balancers\{lb_id}\droplets + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DropletsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers/{lb_id}/droplets", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DropletsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers/{lb_id}/droplets", rawUrl) + { + } + /// + /// To remove a Droplet from a load balancer instance, send a DELETE request to`/v2/load_balancers/$LOAD_BALANCER_ID/droplets`. In the body of the request,there should be a `droplet_ids` attribute containing a list of Droplet IDs.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsDeleteRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsDeleteRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To assign a Droplet to a load balancer instance, send a POST request to`/v2/load_balancers/$LOAD_BALANCER_ID/droplets`. In the body of the request,there should be a `droplet_ids` attribute containing a list of Droplet IDs.Individual Droplets can not be added to a load balancer configured with aDroplet tag. Attempting to do so will result in a "422 Unprocessable Entity"response from the API.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To remove a Droplet from a load balancer instance, send a DELETE request to`/v2/load_balancers/$LOAD_BALANCER_ID/droplets`. In the body of the request,there should be a `droplet_ids` attribute containing a list of Droplet IDs.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsDeleteRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsDeleteRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To assign a Droplet to a load balancer instance, send a POST request to`/v2/load_balancers/$LOAD_BALANCER_ID/droplets`. In the body of the request,there should be a `droplet_ids` attribute containing a list of Droplet IDs.Individual Droplets can not be added to a load balancer configured with aDroplet tag. Attempting to do so will result in a "422 Unprocessable Entity"response from the API.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesDeleteRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesDeleteRequestBody.cs new file mode 100644 index 0000000..db63909 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesDeleteRequestBody.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Forwarding_rulesDeleteRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The forwarding_rules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ForwardingRules { get; set; } +#nullable restore +#else + public List ForwardingRules { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Forwarding_rulesDeleteRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesDeleteRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesDeleteRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "forwarding_rules", n => { ForwardingRules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Forwarding_rule.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("forwarding_rules", ForwardingRules); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesPostRequestBody.cs new file mode 100644 index 0000000..a86be43 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesPostRequestBody.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Forwarding_rulesPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The forwarding_rules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ForwardingRules { get; set; } +#nullable restore +#else + public List ForwardingRules { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Forwarding_rulesPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "forwarding_rules", n => { ForwardingRules = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Forwarding_rule.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("forwarding_rules", ForwardingRules); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesRequestBuilder.cs new file mode 100644 index 0000000..190170b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/Forwarding_rules/Forwarding_rulesRequestBuilder.cs @@ -0,0 +1,171 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules +{ + /// + /// Builds and executes requests for operations under \v2\load_balancers\{lb_id}\forwarding_rules + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Forwarding_rulesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Forwarding_rulesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers/{lb_id}/forwarding_rules", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Forwarding_rulesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers/{lb_id}/forwarding_rules", rawUrl) + { + } + /// + /// To remove forwarding rules from a load balancer instance, send a DELETErequest to `/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules`. In thebody of the request, there should be a `forwarding_rules` attribute containingan array of rules to be removed.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesDeleteRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesDeleteRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To add an additional forwarding rule to a load balancer instance, send a POSTrequest to `/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules`. In the bodyof the request, there should be a `forwarding_rules` attribute containing anarray of rules to be added.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To remove forwarding rules from a load balancer instance, send a DELETErequest to `/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules`. In thebody of the request, there should be a `forwarding_rules` attribute containingan array of rules to be removed.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesDeleteRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesDeleteRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To add an additional forwarding rule to a load balancer instance, send a POSTrequest to `/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules`. In the bodyof the request, there should be a `forwarding_rules` attribute containing anarray of rules to be added.No response body will be sent back, but the response code will indicatesuccess. Specifically, the response code will be a 204, which means that theaction was successful with no returned body data. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Forwarding_rulesRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Forwarding_rulesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_GetResponse.cs new file mode 100644 index 0000000..fe93aff --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithLb_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The load_balancer property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer? LoadBalancer { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer LoadBalancer { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithLb_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "load_balancer", n => { LoadBalancer = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("load_balancer", LoadBalancer); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_ItemRequestBuilder.cs new file mode 100644 index 0000000..d03945f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_ItemRequestBuilder.cs @@ -0,0 +1,303 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets; +using InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item +{ + /// + /// Builds and executes requests for operations under \v2\load_balancers\{lb_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLb_ItemRequestBuilder : BaseRequestBuilder + { + /// The droplets property + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsRequestBuilder Droplets + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Droplets.DropletsRequestBuilder(PathParameters, RequestAdapter); + } + /// The forwarding_rules property + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesRequestBuilder Forwarding_rules + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.Forwarding_rules.Forwarding_rulesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithLb_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers/{lb_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithLb_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers/{lb_id}", rawUrl) + { + } + /// + /// To delete a load balancer instance, disassociating any Droplets assigned to itand removing it from your account, send a DELETE request to`/v2/load_balancers/$LOAD_BALANCER_ID`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a load balancer instance, send a GET request to`/v2/load_balancers/$LOAD_BALANCER_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithLb_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithLb_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a load balancer instance, send a GET request to`/v2/load_balancers/$LOAD_BALANCER_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithLb_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a load balancer's settings, send a PUT request to`/v2/load_balancers/$LOAD_BALANCER_ID`. The request should contain a fullrepresentation of the load balancer including existing attributes. It maycontain _one of_ the `droplets_ids` or `tag` attributes as they are mutuallyexclusive. **Note that any attribute that is not provided will be reset to itsdefault value.** + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithLb_PutResponseAsync(UntypedNode body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithLb_PutResponseAsync(UntypedNode body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a load balancer's settings, send a PUT request to`/v2/load_balancers/$LOAD_BALANCER_ID`. The request should contain a fullrepresentation of the load balancer including existing attributes. It maycontain _one of_ the `droplets_ids` or `tag` attributes as they are mutuallyexclusive. **Note that any attribute that is not provided will be reset to itsdefault value.** + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithLb_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(UntypedNode body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(UntypedNode body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a load balancer instance, disassociating any Droplets assigned to itand removing it from your account, send a DELETE request to`/v2/load_balancers/$LOAD_BALANCER_ID`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about a load balancer instance, send a GET request to`/v2/load_balancers/$LOAD_BALANCER_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update a load balancer's settings, send a PUT request to`/v2/load_balancers/$LOAD_BALANCER_ID`. The request should contain a fullrepresentation of the load balancer including existing attributes. It maycontain _one of_ the `droplets_ids` or `tag` attributes as they are mutuallyexclusive. **Note that any attribute that is not provided will be reset to itsdefault value.** + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(UntypedNode body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(UntypedNode body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromScalar(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLb_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLb_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithLb_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_PutResponse.cs new file mode 100644 index 0000000..bdadbf7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithLb_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The load_balancer property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer? LoadBalancer { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer LoadBalancer { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithLb_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "load_balancer", n => { LoadBalancer = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("load_balancer", LoadBalancer); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_Response.cs new file mode 100644 index 0000000..e4c93ee --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Item/WithLb_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item +{ + [Obsolete("This class is obsolete. Use WithLb_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithLb_Response : global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersGetResponse.cs new file mode 100644 index 0000000..2cb5843 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Load_balancersGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The load_balancers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LoadBalancers { get; set; } +#nullable restore +#else + public List LoadBalancers { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Load_balancersGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "load_balancers", n => { LoadBalancers = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer.CreateFromDiscriminatorValue)?.AsList(); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteCollectionOfObjectValues("load_balancers", LoadBalancers); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersPostResponse.cs new file mode 100644 index 0000000..0a50de2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Load_balancersPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The load_balancer property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer? LoadBalancer { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer LoadBalancer { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Load_balancersPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "load_balancer", n => { LoadBalancer = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Load_balancer.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("load_balancer", LoadBalancer); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersRequestBuilder.cs new file mode 100644 index 0000000..0276e7c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersRequestBuilder.cs @@ -0,0 +1,252 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers +{ + /// + /// Builds and executes requests for operations under \v2\load_balancers + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_balancersRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.load_balancers.item collection + /// A unique identifier for a load balancer. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("lb_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Item.WithLb_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Load_balancersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Load_balancersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/load_balancers{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the load balancer instances on your account, send a GET requestto `/v2/load_balancers`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsLoad_balancersGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsLoad_balancersGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the load balancer instances on your account, send a GET requestto `/v2/load_balancers`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsLoad_balancersGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new load balancer instance, send a POST request to`/v2/load_balancers`.You can specify the Droplets that will sit behind the load balancer using oneof two methods:* Set `droplet_ids` to a list of specific Droplet IDs.* Set `tag` to the name of a tag. All Droplets with this tag applied will be assigned to the load balancer. Additional Droplets will be automatically assigned as they are tagged.These methods are mutually exclusive. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsLoad_balancersPostResponseAsync(UntypedNode body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsLoad_balancersPostResponseAsync(UntypedNode body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new load balancer instance, send a POST request to`/v2/load_balancers`.You can specify the Droplets that will sit behind the load balancer using oneof two methods:* Set `droplet_ids` to a list of specific Droplet IDs.* Set `tag` to the name of a tag. All Droplets with this tag applied will be assigned to the load balancer. Additional Droplets will be automatically assigned as they are tagged.These methods are mutually exclusive. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsLoad_balancersPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UntypedNode body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(UntypedNode body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the load balancer instances on your account, send a GET requestto `/v2/load_balancers`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new load balancer instance, send a POST request to`/v2/load_balancers`.You can specify the Droplets that will sit behind the load balancer using oneof two methods:* Set `droplet_ids` to a list of specific Droplet IDs.* Set `tag` to the name of a tag. All Droplets with this tag applied will be assigned to the load balancer. Additional Droplets will be automatically assigned as they are tagged.These methods are mutually exclusive. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UntypedNode body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UntypedNode body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromScalar(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the load balancer instances on your account, send a GET requestto `/v2/load_balancers`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_balancersRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_balancersRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_balancersRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersResponse.cs new file mode 100644 index 0000000..9326a48 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Load_balancers/Load_balancersResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Load_balancers +{ + [Obsolete("This class is obsolete. Use Load_balancersPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Load_balancersResponse : global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsGetResponse.cs new file mode 100644 index 0000000..705e73c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AlertsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The policies property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Policies { get; set; } +#nullable restore +#else + public List Policies { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AlertsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "policies", n => { Policies = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("policies", Policies); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsPostResponse.cs new file mode 100644 index 0000000..3781c44 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AlertsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The policy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy? Policy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy Policy { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AlertsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "policy", n => { Policy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("policy", Policy); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsRequestBuilder.cs new file mode 100644 index 0000000..bec2ced --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsRequestBuilder.cs @@ -0,0 +1,252 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\alerts + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.monitoring.alerts.item collection + /// A unique identifier for an alert policy. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("alert_uuid", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AlertsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/alerts{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AlertsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/alerts{?page*,per_page*}", rawUrl) + { + } + /// + /// Returns all alert policies that are configured for the given account. To List all alert policies, send a GET request to `/v2/monitoring/alerts`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsAlertsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsAlertsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns all alert policies that are configured for the given account. To List all alert policies, send a GET request to `/v2/monitoring/alerts`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsAlertsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new alert, send a POST request to `/v2/monitoring/alerts`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsAlertsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsAlertsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new alert, send a POST request to `/v2/monitoring/alerts`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsAlertsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns all alert policies that are configured for the given account. To List all alert policies, send a GET request to `/v2/monitoring/alerts`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new alert, send a POST request to `/v2/monitoring/alerts`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns all alert policies that are configured for the given account. To List all alert policies, send a GET request to `/v2/monitoring/alerts`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsResponse.cs new file mode 100644 index 0000000..8e718dd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/AlertsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts +{ + [Obsolete("This class is obsolete. Use AlertsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AlertsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuGetResponse.cs new file mode 100644 index 0000000..f01b973 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAlert_uuGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The policy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy? Policy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy Policy { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithAlert_uuGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "policy", n => { Policy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("policy", Policy); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuItemRequestBuilder.cs new file mode 100644 index 0000000..c1b64ed --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuItemRequestBuilder.cs @@ -0,0 +1,291 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\alerts\{alert_uuid} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_uuItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAlert_uuItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/alerts/{alert_uuid}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAlert_uuItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/alerts/{alert_uuid}", rawUrl) + { + } + /// + /// To delete an alert policy, send a DELETE request to `/v2/monitoring/alerts/{alert_uuid}` + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a given alert policy, send a GET request to `/v2/monitoring/alerts/{alert_uuid}` + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithAlert_uuGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithAlert_uuGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a given alert policy, send a GET request to `/v2/monitoring/alerts/{alert_uuid}` + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithAlert_uuGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update en existing policy, send a PUT request to `v2/monitoring/alerts/{alert_uuid}`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithAlert_uuPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithAlert_uuPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuPutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update en existing policy, send a PUT request to `v2/monitoring/alerts/{alert_uuid}`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithAlert_uuPutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete an alert policy, send a DELETE request to `/v2/monitoring/alerts/{alert_uuid}` + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To retrieve a given alert policy, send a GET request to `/v2/monitoring/alerts/{alert_uuid}` + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update en existing policy, send a PUT request to `v2/monitoring/alerts/{alert_uuid}`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_uuItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_uuItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_uuItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuPutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuPutResponse.cs new file mode 100644 index 0000000..56edbd4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuPutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAlert_uuPutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The policy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy? Policy { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy Policy { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithAlert_uuPutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuPutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuPutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "policy", n => { Policy = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alert_policy.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("policy", Policy); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuResponse.cs new file mode 100644 index 0000000..f0b12e5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Alerts/Item/WithAlert_uuResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item +{ + [Obsolete("This class is obsolete. Use WithAlert_uuGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAlert_uuResponse : global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.Item.WithAlert_uuResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/AppsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/AppsRequestBuilder.cs new file mode 100644 index 0000000..608f392 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/AppsRequestBuilder.cs @@ -0,0 +1,53 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Cpu_percentage; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Memory_percentage; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Restart_count; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\apps + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AppsRequestBuilder : BaseRequestBuilder + { + /// The cpu_percentage property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Cpu_percentage.Cpu_percentageRequestBuilder Cpu_percentage + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Cpu_percentage.Cpu_percentageRequestBuilder(PathParameters, RequestAdapter); + } + /// The memory_percentage property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Memory_percentage.Memory_percentageRequestBuilder Memory_percentage + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Memory_percentage.Memory_percentageRequestBuilder(PathParameters, RequestAdapter); + } + /// The restart_count property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Restart_count.Restart_countRequestBuilder Restart_count + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Restart_count.Restart_countRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AppsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AppsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Cpu_percentage/Cpu_percentageRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Cpu_percentage/Cpu_percentageRequestBuilder.cs new file mode 100644 index 0000000..a9f3f7c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Cpu_percentage/Cpu_percentageRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Cpu_percentage +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\apps\cpu_percentage + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Cpu_percentageRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Cpu_percentageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps/cpu_percentage?app_id={app_id}&end={end}&start={start}{&app_component*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Cpu_percentageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps/cpu_percentage?app_id={app_id}&end={end}&start={start}{&app_component*}", rawUrl) + { + } + /// + /// To retrieve cpu percentage metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/cpu_percentage`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve cpu percentage metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/cpu_percentage`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Cpu_percentage.Cpu_percentageRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Cpu_percentage.Cpu_percentageRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve cpu percentage metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/cpu_percentage`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Cpu_percentageRequestBuilderGetQueryParameters + { + /// The app component name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("app_component")] + public string? AppComponent { get; set; } +#nullable restore +#else + [QueryParameter("app_component")] + public string AppComponent { get; set; } +#endif + /// The app UUID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("app_id")] + public string? AppId { get; set; } +#nullable restore +#else + [QueryParameter("app_id")] + public string AppId { get; set; } +#endif + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Cpu_percentageRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Memory_percentage/Memory_percentageRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Memory_percentage/Memory_percentageRequestBuilder.cs new file mode 100644 index 0000000..7857021 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Memory_percentage/Memory_percentageRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Memory_percentage +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\apps\memory_percentage + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_percentageRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Memory_percentageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps/memory_percentage?app_id={app_id}&end={end}&start={start}{&app_component*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Memory_percentageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps/memory_percentage?app_id={app_id}&end={end}&start={start}{&app_component*}", rawUrl) + { + } + /// + /// To retrieve memory percentage metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/memory_percentage`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve memory percentage metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/memory_percentage`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Memory_percentage.Memory_percentageRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Memory_percentage.Memory_percentageRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve memory percentage metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/memory_percentage`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_percentageRequestBuilderGetQueryParameters + { + /// The app component name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("app_component")] + public string? AppComponent { get; set; } +#nullable restore +#else + [QueryParameter("app_component")] + public string AppComponent { get; set; } +#endif + /// The app UUID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("app_id")] + public string? AppId { get; set; } +#nullable restore +#else + [QueryParameter("app_id")] + public string AppId { get; set; } +#endif + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_percentageRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Restart_count/Restart_countRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Restart_count/Restart_countRequestBuilder.cs new file mode 100644 index 0000000..ef867f9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Apps/Restart_count/Restart_countRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Restart_count +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\apps\restart_count + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Restart_countRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Restart_countRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps/restart_count?app_id={app_id}&end={end}&start={start}{&app_component*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Restart_countRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/apps/restart_count?app_id={app_id}&end={end}&start={start}{&app_component*}", rawUrl) + { + } + /// + /// To retrieve restart count metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/restart_count`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve restart count metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/restart_count`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Restart_count.Restart_countRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.Restart_count.Restart_countRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve restart count metrics for a given app, send a GET request to `/v2/monitoring/metrics/apps/restart_count`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Restart_countRequestBuilderGetQueryParameters + { + /// The app component name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("app_component")] + public string? AppComponent { get; set; } +#nullable restore +#else + [QueryParameter("app_component")] + public string AppComponent { get; set; } +#endif + /// The app UUID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("app_id")] + public string? AppId { get; set; } +#nullable restore +#else + [QueryParameter("app_id")] + public string AppId { get; set; } +#endif + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Restart_countRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/BandwidthRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/BandwidthRequestBuilder.cs new file mode 100644 index 0000000..6fd1052 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/BandwidthRequestBuilder.cs @@ -0,0 +1,168 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\bandwidth + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class BandwidthRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public BandwidthRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/bandwidth?direction={direction}&end={end}&host_id={host_id}&interface={interface}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public BandwidthRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/bandwidth?direction={direction}&end={end}&host_id={host_id}&interface={interface}&start={start}", rawUrl) + { + } + /// + /// To retrieve bandwidth metrics for a given Droplet, send a GET request to `/v2/monitoring/metrics/droplet/bandwidth`. Use the `interface` query parameter to specify if the results should be for the `private` or `public` interface. Use the `direction` query parameter to specify if the results should be for `inbound` or `outbound` traffic.The metrics in the response body are in megabits per second (Mbps). + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve bandwidth metrics for a given Droplet, send a GET request to `/v2/monitoring/metrics/droplet/bandwidth`. Use the `interface` query parameter to specify if the results should be for the `private` or `public` interface. Use the `direction` query parameter to specify if the results should be for `inbound` or `outbound` traffic.The metrics in the response body are in megabits per second (Mbps). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth.BandwidthRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth.BandwidthRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve bandwidth metrics for a given Droplet, send a GET request to `/v2/monitoring/metrics/droplet/bandwidth`. Use the `interface` query parameter to specify if the results should be for the `private` or `public` interface. Use the `direction` query parameter to specify if the results should be for `inbound` or `outbound` traffic.The metrics in the response body are in megabits per second (Mbps). + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class BandwidthRequestBuilderGetQueryParameters + { + /// The traffic direction. + [Obsolete("This property is deprecated, use DirectionAsGetDirectionQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("direction")] + public string? Direction { get; set; } +#nullable restore +#else + [QueryParameter("direction")] + public string Direction { get; set; } +#endif + /// The traffic direction. + [QueryParameter("direction")] + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth.GetDirectionQueryParameterType? DirectionAsGetDirectionQueryParameterType { get; set; } + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// The network interface. + [Obsolete("This property is deprecated, use InterfaceAsGetInterfaceQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("interface")] + public string? Interface { get; set; } +#nullable restore +#else + [QueryParameter("interface")] + public string Interface { get; set; } +#endif + /// The network interface. + [QueryParameter("interface")] + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth.GetInterfaceQueryParameterType? InterfaceAsGetInterfaceQueryParameterType { get; set; } + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class BandwidthRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/GetDirectionQueryParameterType.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/GetDirectionQueryParameterType.cs new file mode 100644 index 0000000..24200f5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/GetDirectionQueryParameterType.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum GetDirectionQueryParameterType + #pragma warning restore CS1591 + { + [EnumMember(Value = "inbound")] + #pragma warning disable CS1591 + Inbound, + #pragma warning restore CS1591 + [EnumMember(Value = "outbound")] + #pragma warning disable CS1591 + Outbound, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/GetInterfaceQueryParameterType.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/GetInterfaceQueryParameterType.cs new file mode 100644 index 0000000..529b6d6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Bandwidth/GetInterfaceQueryParameterType.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum GetInterfaceQueryParameterType + #pragma warning restore CS1591 + { + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + [EnumMember(Value = "public")] + #pragma warning disable CS1591 + Public, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Cpu/CpuRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Cpu/CpuRequestBuilder.cs new file mode 100644 index 0000000..3ec6510 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Cpu/CpuRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Cpu +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\cpu + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CpuRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CpuRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/cpu?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CpuRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/cpu?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve CPU metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/cpu`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve CPU metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/cpu`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Cpu.CpuRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Cpu.CpuRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve CPU metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/cpu`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CpuRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CpuRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/DropletRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/DropletRequestBuilder.cs new file mode 100644 index 0000000..c99b5ef --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/DropletRequestBuilder.cs @@ -0,0 +1,101 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Cpu; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_free; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_size; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_15; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_1; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_5; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_available; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_cached; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_free; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_total; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DropletRequestBuilder : BaseRequestBuilder + { + /// The bandwidth property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth.BandwidthRequestBuilder Bandwidth + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Bandwidth.BandwidthRequestBuilder(PathParameters, RequestAdapter); + } + /// The cpu property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Cpu.CpuRequestBuilder Cpu + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Cpu.CpuRequestBuilder(PathParameters, RequestAdapter); + } + /// The filesystem_free property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_free.Filesystem_freeRequestBuilder Filesystem_free + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_free.Filesystem_freeRequestBuilder(PathParameters, RequestAdapter); + } + /// The filesystem_size property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_size.Filesystem_sizeRequestBuilder Filesystem_size + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_size.Filesystem_sizeRequestBuilder(PathParameters, RequestAdapter); + } + /// The load_1 property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_1.Load_1RequestBuilder Load_1 + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_1.Load_1RequestBuilder(PathParameters, RequestAdapter); + } + /// The load_15 property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_15.Load_15RequestBuilder Load_15 + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_15.Load_15RequestBuilder(PathParameters, RequestAdapter); + } + /// The load_5 property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_5.Load_5RequestBuilder Load_5 + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_5.Load_5RequestBuilder(PathParameters, RequestAdapter); + } + /// The memory_available property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_available.Memory_availableRequestBuilder Memory_available + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_available.Memory_availableRequestBuilder(PathParameters, RequestAdapter); + } + /// The memory_cached property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_cached.Memory_cachedRequestBuilder Memory_cached + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_cached.Memory_cachedRequestBuilder(PathParameters, RequestAdapter); + } + /// The memory_free property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_free.Memory_freeRequestBuilder Memory_free + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_free.Memory_freeRequestBuilder(PathParameters, RequestAdapter); + } + /// The memory_total property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_total.Memory_totalRequestBuilder Memory_total + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_total.Memory_totalRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DropletRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DropletRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Filesystem_free/Filesystem_freeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Filesystem_free/Filesystem_freeRequestBuilder.cs new file mode 100644 index 0000000..01d2baf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Filesystem_free/Filesystem_freeRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_free +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\filesystem_free + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Filesystem_freeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Filesystem_freeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/filesystem_free?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Filesystem_freeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/filesystem_free?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve filesystem free metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/filesystem_free`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve filesystem free metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/filesystem_free`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_free.Filesystem_freeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_free.Filesystem_freeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve filesystem free metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/filesystem_free`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Filesystem_freeRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Filesystem_freeRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Filesystem_size/Filesystem_sizeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Filesystem_size/Filesystem_sizeRequestBuilder.cs new file mode 100644 index 0000000..4e9c796 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Filesystem_size/Filesystem_sizeRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_size +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\filesystem_size + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Filesystem_sizeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Filesystem_sizeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/filesystem_size?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Filesystem_sizeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/filesystem_size?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve filesystem size metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/filesystem_size`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve filesystem size metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/filesystem_size`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_size.Filesystem_sizeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Filesystem_size.Filesystem_sizeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve filesystem size metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/filesystem_size`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Filesystem_sizeRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Filesystem_sizeRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_1/Load_1RequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_1/Load_1RequestBuilder.cs new file mode 100644 index 0000000..2edc405 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_1/Load_1RequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_1 +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\load_1 + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_1RequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Load_1RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/load_1?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Load_1RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/load_1?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve 1 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_1`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve 1 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_1`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_1.Load_1RequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_1.Load_1RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve 1 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_1`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_1RequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_1RequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_15/Load_15RequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_15/Load_15RequestBuilder.cs new file mode 100644 index 0000000..4d63ae6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_15/Load_15RequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_15 +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\load_15 + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_15RequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Load_15RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/load_15?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Load_15RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/load_15?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve 15 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_15`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve 15 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_15`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_15.Load_15RequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_15.Load_15RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve 15 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_15`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_15RequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_15RequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_5/Load_5RequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_5/Load_5RequestBuilder.cs new file mode 100644 index 0000000..939aa3b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Load_5/Load_5RequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_5 +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\load_5 + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_5RequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Load_5RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/load_5?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Load_5RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/load_5?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve 5 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_5`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve 5 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_5`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_5.Load_5RequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Load_5.Load_5RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve 5 minute load average metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/load_5`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_5RequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_5RequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_available/Memory_availableRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_available/Memory_availableRequestBuilder.cs new file mode 100644 index 0000000..53fb325 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_available/Memory_availableRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_available +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\memory_available + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_availableRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Memory_availableRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_available?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Memory_availableRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_available?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve available memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_available`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve available memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_available`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_available.Memory_availableRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_available.Memory_availableRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve available memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_available`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_availableRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_availableRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_cached/Memory_cachedRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_cached/Memory_cachedRequestBuilder.cs new file mode 100644 index 0000000..af5657f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_cached/Memory_cachedRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_cached +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\memory_cached + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_cachedRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Memory_cachedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_cached?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Memory_cachedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_cached?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve cached memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_cached`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve cached memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_cached`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_cached.Memory_cachedRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_cached.Memory_cachedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve cached memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_cached`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_cachedRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_cachedRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_free/Memory_freeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_free/Memory_freeRequestBuilder.cs new file mode 100644 index 0000000..0c81940 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_free/Memory_freeRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_free +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\memory_free + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_freeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Memory_freeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_free?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Memory_freeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_free?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve free memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_free`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve free memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_free`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_free.Memory_freeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_free.Memory_freeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve free memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_free`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_freeRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_freeRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_total/Memory_totalRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_total/Memory_totalRequestBuilder.cs new file mode 100644 index 0000000..a86584a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Droplet/Memory_total/Memory_totalRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_total +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\droplet\memory_total + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_totalRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Memory_totalRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_total?end={end}&host_id={host_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Memory_totalRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/droplet/memory_total?end={end}&host_id={host_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve total memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_total`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve total memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_total`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_total.Memory_totalRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.Memory_total.Memory_totalRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve total memory metrics for a given droplet, send a GET request to `/v2/monitoring/metrics/droplet/memory_total`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_totalRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// The droplet ID. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("host_id")] + public string? HostId { get; set; } +#nullable restore +#else + [QueryParameter("host_id")] + public string HostId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Memory_totalRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_connections/Droplets_connectionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_connections/Droplets_connectionsRequestBuilder.cs new file mode 100644 index 0000000..0cbe6fb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_connections/Droplets_connectionsRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_connections +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_connections + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_connectionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_connectionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_connections?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_connectionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_connections?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets active connections for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_connections`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets active connections for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_connections`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_connections.Droplets_connectionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_connections.Droplets_connectionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets active connections for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_connections`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_connectionsRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_connectionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_downtime/Droplets_downtimeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_downtime/Droplets_downtimeRequestBuilder.cs new file mode 100644 index 0000000..0d9b0a0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_downtime/Droplets_downtimeRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_downtime +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_downtime + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_downtimeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_downtimeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_downtime?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_downtimeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_downtime?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets downtime status for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_downtime`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets downtime status for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_downtime`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_downtime.Droplets_downtimeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_downtime.Droplets_downtimeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets downtime status for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_downtime`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_downtimeRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_downtimeRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_health_checks/Droplets_health_checksRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_health_checks/Droplets_health_checksRequestBuilder.cs new file mode 100644 index 0000000..33f4298 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_health_checks/Droplets_health_checksRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_health_checks +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_health_checks + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_health_checksRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_health_checksRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_health_checks?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_health_checksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_health_checks?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets health check status for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_health_checks`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets health check status for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_health_checks`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_health_checks.Droplets_health_checksRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_health_checks.Droplets_health_checksRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets health check status for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_health_checks`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_health_checksRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_health_checksRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_50p/Droplets_http_response_time_50pRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_50p/Droplets_http_response_time_50pRequestBuilder.cs new file mode 100644 index 0000000..b4ed87f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_50p/Droplets_http_response_time_50pRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_50p +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_response_time_50p + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_50pRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_50pRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_50pRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets 50th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets 50th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_50p.Droplets_http_response_time_50pRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_50p.Droplets_http_response_time_50pRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets 50th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_50pRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_50pRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_95p/Droplets_http_response_time_95pRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_95p/Droplets_http_response_time_95pRequestBuilder.cs new file mode 100644 index 0000000..3ba5167 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_95p/Droplets_http_response_time_95pRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_95p +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_response_time_95p + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_95pRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_95pRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_95pRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets 95th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets 95th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_95p.Droplets_http_response_time_95pRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_95p.Droplets_http_response_time_95pRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets 95th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_95pRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_95pRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_99p/Droplets_http_response_time_99pRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_99p/Droplets_http_response_time_99pRequestBuilder.cs new file mode 100644 index 0000000..5986d6f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_99p/Droplets_http_response_time_99pRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_99p +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_response_time_99p + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_99pRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_99pRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_99pRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets 99th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets 99th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_99p.Droplets_http_response_time_99pRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_99p.Droplets_http_response_time_99pRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets 99th percentile HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_99pRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_99pRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_avg/Droplets_http_response_time_avgRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_avg/Droplets_http_response_time_avgRequestBuilder.cs new file mode 100644 index 0000000..4eaf0bc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_response_time_avg/Droplets_http_response_time_avgRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_avg +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_response_time_avg + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_avgRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_avgRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_response_time_avgRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets average HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets average HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_avg.Droplets_http_response_time_avgRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_avg.Droplets_http_response_time_avgRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets average HTTP response time in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_avgRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_response_time_avgRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_responses/Droplets_http_responsesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_responses/Droplets_http_responsesRequestBuilder.cs new file mode 100644 index 0000000..24b57ab --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_responses/Droplets_http_responsesRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_responses +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_responses + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_responsesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_responsesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_responses?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_responsesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_responses?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets HTTP rate of response code for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_responses`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets HTTP rate of response code for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_responses`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_responses.Droplets_http_responsesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_responses.Droplets_http_responsesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets HTTP rate of response code for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_responses`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_responsesRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_responsesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_50p/Droplets_http_session_duration_50pRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_50p/Droplets_http_session_duration_50pRequestBuilder.cs new file mode 100644 index 0000000..8d332aa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_50p/Droplets_http_session_duration_50pRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_50p +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_session_duration_50p + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_50pRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_session_duration_50pRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_session_duration_50pRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets 50th percentile HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets 50th percentile HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_50p.Droplets_http_session_duration_50pRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_50p.Droplets_http_session_duration_50pRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets 50th percentile HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_50pRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_50pRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_95p/Droplets_http_session_duration_95pRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_95p/Droplets_http_session_duration_95pRequestBuilder.cs new file mode 100644 index 0000000..90ed35a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_95p/Droplets_http_session_duration_95pRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_95p +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_session_duration_95p + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_95pRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_session_duration_95pRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_session_duration_95pRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets 95th percentile HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets 95th percentile HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_95p.Droplets_http_session_duration_95pRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_95p.Droplets_http_session_duration_95pRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets 95th percentile HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_95pRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_95pRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_avg/Droplets_http_session_duration_avgRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_avg/Droplets_http_session_duration_avgRequestBuilder.cs new file mode 100644 index 0000000..fca4bf7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_http_session_duration_avg/Droplets_http_session_duration_avgRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_avg +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_http_session_duration_avg + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_avgRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_http_session_duration_avgRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_http_session_duration_avgRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets average HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets average HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_avg.Droplets_http_session_duration_avgRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_avg.Droplets_http_session_duration_avgRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets average HTTP session duration in seconds for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_avgRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_http_session_duration_avgRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_queue_size/Droplets_queue_sizeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_queue_size/Droplets_queue_sizeRequestBuilder.cs new file mode 100644 index 0000000..7f24eac --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Droplets_queue_size/Droplets_queue_sizeRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_queue_size +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\droplets_queue_size + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_queue_sizeRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplets_queue_sizeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_queue_size?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplets_queue_sizeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/droplets_queue_size?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve Droplets queue size for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_queue_size`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve Droplets queue size for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_queue_size`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_queue_size.Droplets_queue_sizeRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_queue_size.Droplets_queue_sizeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve Droplets queue size for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/droplets_queue_size`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_queue_sizeRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplets_queue_sizeRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_connections_current/Frontend_connections_currentRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_connections_current/Frontend_connections_currentRequestBuilder.cs new file mode 100644 index 0000000..36ec3b7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_connections_current/Frontend_connections_currentRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_current +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_connections_current + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_connections_currentRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_connections_currentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_connections_current?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_connections_currentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_connections_current?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend total current active connections for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_connections_current`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend total current active connections for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_connections_current`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_current.Frontend_connections_currentRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_current.Frontend_connections_currentRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend total current active connections for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_connections_current`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_connections_currentRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_connections_currentRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_connections_limit/Frontend_connections_limitRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_connections_limit/Frontend_connections_limitRequestBuilder.cs new file mode 100644 index 0000000..d19ee26 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_connections_limit/Frontend_connections_limitRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_limit +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_connections_limit + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_connections_limitRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_connections_limitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_connections_limit?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_connections_limitRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_connections_limit?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend max connections limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_connections_limit`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend max connections limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_connections_limit`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_limit.Frontend_connections_limitRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_limit.Frontend_connections_limitRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend max connections limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_connections_limit`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_connections_limitRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_connections_limitRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_cpu_utilization/Frontend_cpu_utilizationRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_cpu_utilization/Frontend_cpu_utilizationRequestBuilder.cs new file mode 100644 index 0000000..fc9307f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_cpu_utilization/Frontend_cpu_utilizationRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_cpu_utilization +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_cpu_utilization + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_cpu_utilizationRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_cpu_utilizationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_cpu_utilizationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend average percentage CPU utilization for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend average percentage CPU utilization for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_cpu_utilization.Frontend_cpu_utilizationRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_cpu_utilization.Frontend_cpu_utilizationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend average percentage CPU utilization for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_cpu_utilizationRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_cpu_utilizationRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_firewall_dropped_bytes/Frontend_firewall_dropped_bytesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_firewall_dropped_bytes/Frontend_firewall_dropped_bytesRequestBuilder.cs new file mode 100644 index 0000000..1c725af --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_firewall_dropped_bytes/Frontend_firewall_dropped_bytesRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_bytes +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_firewall_dropped_bytes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_firewall_dropped_bytesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_firewall_dropped_bytesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_firewall_dropped_bytesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve firewall dropped bytes for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes`. This is currently only supported for network load balancers. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve firewall dropped bytes for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes`. This is currently only supported for network load balancers. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_bytes.Frontend_firewall_dropped_bytesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_bytes.Frontend_firewall_dropped_bytesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve firewall dropped bytes for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes`. This is currently only supported for network load balancers. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_firewall_dropped_bytesRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_firewall_dropped_bytesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_firewall_dropped_packets/Frontend_firewall_dropped_packetsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_firewall_dropped_packets/Frontend_firewall_dropped_packetsRequestBuilder.cs new file mode 100644 index 0000000..6abb6e5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_firewall_dropped_packets/Frontend_firewall_dropped_packetsRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_packets +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_firewall_dropped_packets + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_firewall_dropped_packetsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_firewall_dropped_packetsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_firewall_dropped_packetsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve firewall dropped packets per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets`. This is currently only supported for network load balancers. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve firewall dropped packets per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets`. This is currently only supported for network load balancers. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_packets.Frontend_firewall_dropped_packetsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_packets.Frontend_firewall_dropped_packetsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve firewall dropped packets per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets`. This is currently only supported for network load balancers. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_firewall_dropped_packetsRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_firewall_dropped_packetsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_http_requests_per_second/Frontend_http_requests_per_secondRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_http_requests_per_second/Frontend_http_requests_per_secondRequestBuilder.cs new file mode 100644 index 0000000..1abfbcf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_http_requests_per_second/Frontend_http_requests_per_secondRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_requests_per_second +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_http_requests_per_second + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_http_requests_per_secondRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_http_requests_per_secondRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_http_requests_per_secondRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend HTTP requests per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend HTTP requests per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_requests_per_second.Frontend_http_requests_per_secondRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_requests_per_second.Frontend_http_requests_per_secondRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend HTTP requests per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_http_requests_per_secondRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_http_requests_per_secondRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_http_responses/Frontend_http_responsesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_http_responses/Frontend_http_responsesRequestBuilder.cs new file mode 100644 index 0000000..a9f768c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_http_responses/Frontend_http_responsesRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_responses +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_http_responses + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_http_responsesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_http_responsesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_http_responses?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_http_responsesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_http_responses?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend HTTP rate of response code for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_http_responses`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend HTTP rate of response code for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_http_responses`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_responses.Frontend_http_responsesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_responses.Frontend_http_responsesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend HTTP rate of response code for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_http_responses`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_http_responsesRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_http_responsesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_http/Frontend_network_throughput_httpRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_http/Frontend_network_throughput_httpRequestBuilder.cs new file mode 100644 index 0000000..7a5998d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_http/Frontend_network_throughput_httpRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_http +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_network_throughput_http + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_httpRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_network_throughput_httpRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_network_throughput_httpRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend HTTP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend HTTP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_http.Frontend_network_throughput_httpRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_http.Frontend_network_throughput_httpRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend HTTP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_httpRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_httpRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_tcp/Frontend_network_throughput_tcpRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_tcp/Frontend_network_throughput_tcpRequestBuilder.cs new file mode 100644 index 0000000..15a2fb3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_tcp/Frontend_network_throughput_tcpRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_tcp +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_network_throughput_tcp + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_tcpRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_network_throughput_tcpRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_network_throughput_tcpRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend TCP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend TCP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_tcp.Frontend_network_throughput_tcpRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_tcp.Frontend_network_throughput_tcpRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend TCP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_tcpRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_tcpRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_udp/Frontend_network_throughput_udpRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_udp/Frontend_network_throughput_udpRequestBuilder.cs new file mode 100644 index 0000000..bed17d5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_network_throughput_udp/Frontend_network_throughput_udpRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_udp +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_network_throughput_udp + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_udpRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_network_throughput_udpRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_network_throughput_udpRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend UDP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend UDP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_udp.Frontend_network_throughput_udpRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_udp.Frontend_network_throughput_udpRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend UDP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_udpRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_network_throughput_udpRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_nlb_tcp_network_throughput/Frontend_nlb_tcp_network_throughputRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_nlb_tcp_network_throughput/Frontend_nlb_tcp_network_throughputRequestBuilder.cs new file mode 100644 index 0000000..3d6bd5e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_nlb_tcp_network_throughput/Frontend_nlb_tcp_network_throughputRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_tcp_network_throughput +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_nlb_tcp_network_throughput + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_nlb_tcp_network_throughputRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_nlb_tcp_network_throughputRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_nlb_tcp_network_throughputRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend TCP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend TCP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_tcp_network_throughput.Frontend_nlb_tcp_network_throughputRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_tcp_network_throughput.Frontend_nlb_tcp_network_throughputRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend TCP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_nlb_tcp_network_throughputRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_nlb_tcp_network_throughputRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_nlb_udp_network_throughput/Frontend_nlb_udp_network_throughputRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_nlb_udp_network_throughput/Frontend_nlb_udp_network_throughputRequestBuilder.cs new file mode 100644 index 0000000..ad2dffa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_nlb_udp_network_throughput/Frontend_nlb_udp_network_throughputRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_udp_network_throughput +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_nlb_udp_network_throughput + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_nlb_udp_network_throughputRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_nlb_udp_network_throughputRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_nlb_udp_network_throughputRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend UDP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend UDP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_udp_network_throughput.Frontend_nlb_udp_network_throughputRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_udp_network_throughput.Frontend_nlb_udp_network_throughputRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend UDP throughput in bytes per second for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_nlb_udp_network_throughputRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_nlb_udp_network_throughputRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_current/Frontend_tls_connections_currentRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_current/Frontend_tls_connections_currentRequestBuilder.cs new file mode 100644 index 0000000..1fcb38a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_current/Frontend_tls_connections_currentRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_current +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_tls_connections_current + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_currentRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_tls_connections_currentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_tls_connections_currentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend current TLS connections rate for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend current TLS connections rate for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_current.Frontend_tls_connections_currentRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_current.Frontend_tls_connections_currentRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend current TLS connections rate for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_currentRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_currentRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_exceeding_rate_limit/Frontend_tls_connections_exceeding_rate_limitRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_exceeding_rate_limit/Frontend_tls_connections_exceeding_rate_limitRequestBuilder.cs new file mode 100644 index 0000000..47b2822 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_exceeding_rate_limit/Frontend_tls_connections_exceeding_rate_limitRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_exceeding_rate_limit +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_tls_connections_exceeding_rate_limit + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_exceeding_rate_limitRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_tls_connections_exceeding_rate_limitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_tls_connections_exceeding_rate_limitRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend closed TLS connections for exceeded rate limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend closed TLS connections for exceeded rate limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_exceeding_rate_limit.Frontend_tls_connections_exceeding_rate_limitRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_exceeding_rate_limit.Frontend_tls_connections_exceeding_rate_limitRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend closed TLS connections for exceeded rate limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_exceeding_rate_limitRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_exceeding_rate_limitRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_limit/Frontend_tls_connections_limitRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_limit/Frontend_tls_connections_limitRequestBuilder.cs new file mode 100644 index 0000000..9744fe4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Frontend_tls_connections_limit/Frontend_tls_connections_limitRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_limit +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer\frontend_tls_connections_limit + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_limitRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Frontend_tls_connections_limitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit?end={end}&lb_id={lb_id}&start={start}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Frontend_tls_connections_limitRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit?end={end}&lb_id={lb_id}&start={start}", rawUrl) + { + } + /// + /// To retrieve frontend max TLS connections limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Metrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve frontend max TLS connections limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_limit.Frontend_tls_connections_limitRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_limit.Frontend_tls_connections_limitRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve frontend max TLS connections limit for a given load balancer, send a GET request to `/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_limitRequestBuilderGetQueryParameters + { + /// UNIX timestamp to end metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("end")] + public string? End { get; set; } +#nullable restore +#else + [QueryParameter("end")] + public string End { get; set; } +#endif + /// A unique identifier for a load balancer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("lb_id")] + public string? LbId { get; set; } +#nullable restore +#else + [QueryParameter("lb_id")] + public string LbId { get; set; } +#endif + /// UNIX timestamp to start metric window. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("start")] + public string? Start { get; set; } +#nullable restore +#else + [QueryParameter("start")] + public string Start { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Frontend_tls_connections_limitRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Load_balancerRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Load_balancerRequestBuilder.cs new file mode 100644 index 0000000..1eeda81 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/Load_balancer/Load_balancerRequestBuilder.cs @@ -0,0 +1,197 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_connections; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_downtime; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_health_checks; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_50p; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_95p; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_99p; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_avg; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_responses; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_50p; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_95p; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_avg; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_queue_size; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_current; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_limit; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_cpu_utilization; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_bytes; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_packets; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_requests_per_second; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_responses; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_http; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_tcp; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_udp; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_tcp_network_throughput; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_udp_network_throughput; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_current; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_exceeding_rate_limit; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_limit; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics\load_balancer + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Load_balancerRequestBuilder : BaseRequestBuilder + { + /// The droplets_connections property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_connections.Droplets_connectionsRequestBuilder Droplets_connections + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_connections.Droplets_connectionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_downtime property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_downtime.Droplets_downtimeRequestBuilder Droplets_downtime + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_downtime.Droplets_downtimeRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_health_checks property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_health_checks.Droplets_health_checksRequestBuilder Droplets_health_checks + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_health_checks.Droplets_health_checksRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_responses property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_responses.Droplets_http_responsesRequestBuilder Droplets_http_responses + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_responses.Droplets_http_responsesRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_response_time_50p property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_50p.Droplets_http_response_time_50pRequestBuilder Droplets_http_response_time_50p + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_50p.Droplets_http_response_time_50pRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_response_time_95p property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_95p.Droplets_http_response_time_95pRequestBuilder Droplets_http_response_time_95p + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_95p.Droplets_http_response_time_95pRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_response_time_99p property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_99p.Droplets_http_response_time_99pRequestBuilder Droplets_http_response_time_99p + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_99p.Droplets_http_response_time_99pRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_response_time_avg property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_avg.Droplets_http_response_time_avgRequestBuilder Droplets_http_response_time_avg + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_response_time_avg.Droplets_http_response_time_avgRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_session_duration_50p property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_50p.Droplets_http_session_duration_50pRequestBuilder Droplets_http_session_duration_50p + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_50p.Droplets_http_session_duration_50pRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_session_duration_95p property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_95p.Droplets_http_session_duration_95pRequestBuilder Droplets_http_session_duration_95p + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_95p.Droplets_http_session_duration_95pRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_http_session_duration_avg property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_avg.Droplets_http_session_duration_avgRequestBuilder Droplets_http_session_duration_avg + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_http_session_duration_avg.Droplets_http_session_duration_avgRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets_queue_size property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_queue_size.Droplets_queue_sizeRequestBuilder Droplets_queue_size + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Droplets_queue_size.Droplets_queue_sizeRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_connections_current property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_current.Frontend_connections_currentRequestBuilder Frontend_connections_current + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_current.Frontend_connections_currentRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_connections_limit property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_limit.Frontend_connections_limitRequestBuilder Frontend_connections_limit + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_connections_limit.Frontend_connections_limitRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_cpu_utilization property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_cpu_utilization.Frontend_cpu_utilizationRequestBuilder Frontend_cpu_utilization + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_cpu_utilization.Frontend_cpu_utilizationRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_firewall_dropped_bytes property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_bytes.Frontend_firewall_dropped_bytesRequestBuilder Frontend_firewall_dropped_bytes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_bytes.Frontend_firewall_dropped_bytesRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_firewall_dropped_packets property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_packets.Frontend_firewall_dropped_packetsRequestBuilder Frontend_firewall_dropped_packets + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_firewall_dropped_packets.Frontend_firewall_dropped_packetsRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_http_requests_per_second property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_requests_per_second.Frontend_http_requests_per_secondRequestBuilder Frontend_http_requests_per_second + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_requests_per_second.Frontend_http_requests_per_secondRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_http_responses property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_responses.Frontend_http_responsesRequestBuilder Frontend_http_responses + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_http_responses.Frontend_http_responsesRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_network_throughput_http property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_http.Frontend_network_throughput_httpRequestBuilder Frontend_network_throughput_http + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_http.Frontend_network_throughput_httpRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_network_throughput_tcp property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_tcp.Frontend_network_throughput_tcpRequestBuilder Frontend_network_throughput_tcp + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_tcp.Frontend_network_throughput_tcpRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_network_throughput_udp property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_udp.Frontend_network_throughput_udpRequestBuilder Frontend_network_throughput_udp + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_network_throughput_udp.Frontend_network_throughput_udpRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_nlb_tcp_network_throughput property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_tcp_network_throughput.Frontend_nlb_tcp_network_throughputRequestBuilder Frontend_nlb_tcp_network_throughput + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_tcp_network_throughput.Frontend_nlb_tcp_network_throughputRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_nlb_udp_network_throughput property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_udp_network_throughput.Frontend_nlb_udp_network_throughputRequestBuilder Frontend_nlb_udp_network_throughput + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_nlb_udp_network_throughput.Frontend_nlb_udp_network_throughputRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_tls_connections_current property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_current.Frontend_tls_connections_currentRequestBuilder Frontend_tls_connections_current + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_current.Frontend_tls_connections_currentRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_tls_connections_exceeding_rate_limit property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_exceeding_rate_limit.Frontend_tls_connections_exceeding_rate_limitRequestBuilder Frontend_tls_connections_exceeding_rate_limit + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_exceeding_rate_limit.Frontend_tls_connections_exceeding_rate_limitRequestBuilder(PathParameters, RequestAdapter); + } + /// The frontend_tls_connections_limit property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_limit.Frontend_tls_connections_limitRequestBuilder Frontend_tls_connections_limit + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Frontend_tls_connections_limit.Frontend_tls_connections_limitRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Load_balancerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Load_balancerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics/load_balancer", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/MetricsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/MetricsRequestBuilder.cs new file mode 100644 index 0000000..6bd4ba5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Metrics/MetricsRequestBuilder.cs @@ -0,0 +1,53 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\metrics + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MetricsRequestBuilder : BaseRequestBuilder + { + /// The apps property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.AppsRequestBuilder Apps + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Apps.AppsRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplet property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.DropletRequestBuilder Droplet + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Droplet.DropletRequestBuilder(PathParameters, RequestAdapter); + } + /// The load_balancer property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Load_balancerRequestBuilder Load_balancer + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.Load_balancer.Load_balancerRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MetricsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/metrics", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/MonitoringRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/MonitoringRequestBuilder.cs new file mode 100644 index 0000000..be5fbe0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/MonitoringRequestBuilder.cs @@ -0,0 +1,53 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring +{ + /// + /// Builds and executes requests for operations under \v2\monitoring + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MonitoringRequestBuilder : BaseRequestBuilder + { + /// The alerts property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsRequestBuilder Alerts + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Alerts.AlertsRequestBuilder(PathParameters, RequestAdapter); + } + /// The metrics property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.MetricsRequestBuilder Metrics + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter); + } + /// The sinks property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksRequestBuilder Sinks + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MonitoringRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MonitoringRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsGetResponse.cs new file mode 100644 index 0000000..534cee6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DestinationsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The destinations property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Destinations { get; set; } +#nullable restore +#else + public List Destinations { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DestinationsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "destinations", n => { Destinations = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("destinations", Destinations); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsPostResponse.cs new file mode 100644 index 0000000..81f18de --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DestinationsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The destination property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials? Destination { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials Destination { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DestinationsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "destination", n => { Destination = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("destination", Destination); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsRequestBuilder.cs new file mode 100644 index 0000000..4ab595a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\sinks\destinations + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DestinationsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.monitoring.sinks.destinations.item collection + /// A unique identifier for a destination. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("destination_uuid", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DestinationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks/destinations", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DestinationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks/destinations", rawUrl) + { + } + /// + /// To list all logging destinations, send a GET request to `/v2/monitoring/sinks/destinations`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDestinationsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDestinationsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all logging destinations, send a GET request to `/v2/monitoring/sinks/destinations`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDestinationsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new destination, send a POST request to `/v2/monitoring/sinks/destinations`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsDestinationsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsDestinationsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new destination, send a POST request to `/v2/monitoring/sinks/destinations`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsDestinationsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all logging destinations, send a GET request to `/v2/monitoring/sinks/destinations`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new destination, send a POST request to `/v2/monitoring/sinks/destinations`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DestinationsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DestinationsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsResponse.cs new file mode 100644 index 0000000..0579ee1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/DestinationsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations +{ + [Obsolete("This class is obsolete. Use DestinationsPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DestinationsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuGetResponse.cs new file mode 100644 index 0000000..7681cd8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDestination_uuGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The destination property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials? Destination { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials Destination { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithDestination_uuGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "destination", n => { Destination = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Destination_omit_credentials.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("destination", Destination); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuItemRequestBuilder.cs new file mode 100644 index 0000000..ab0352e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuItemRequestBuilder.cs @@ -0,0 +1,256 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\sinks\destinations\{destination_uuid} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDestination_uuItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDestination_uuItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks/destinations/{destination_uuid}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDestination_uuItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks/destinations/{destination_uuid}", rawUrl) + { + } + /// + /// To delete a destination and all associated sinks, send a DELETE request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get the details of a destination, send a GET request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithDestination_uuGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithDestination_uuGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get the details of a destination, send a GET request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithDestination_uuGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the details of a destination, send a PATCH request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a destination and all associated sinks, send a DELETE request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To get the details of a destination, send a GET request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the details of a destination, send a PATCH request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Destination_request body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDestination_uuItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDestination_uuItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithDestination_uuItemRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuResponse.cs new file mode 100644 index 0000000..3a5a430 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Destinations/Item/WithDestination_uuResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item +{ + [Obsolete("This class is obsolete. Use WithDestination_uuGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithDestination_uuResponse : global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.Item.WithDestination_uuResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuGetResponse.cs new file mode 100644 index 0000000..f777908 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSink_uuGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The sink property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Sinks_response? Sink { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Sinks_response Sink { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithSink_uuGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sink", n => { Sink = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Sinks_response.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("sink", Sink); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuItemRequestBuilder.cs new file mode 100644 index 0000000..dfe8584 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuItemRequestBuilder.cs @@ -0,0 +1,194 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\sinks\{sink_uuid} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSink_uuItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSink_uuItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks/{sink_uuid}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSink_uuItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks/{sink_uuid}", rawUrl) + { + } + /// + /// To delete a sink, send a DELETE request to `/v2/monitoring/sinks/${sink_uuid}`. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get the details of a sink (resources and destination), send a GET request to `/v2/monitoring/sinks/${sink_uuid}`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithSink_uuGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithSink_uuGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get the details of a sink (resources and destination), send a GET request to `/v2/monitoring/sinks/${sink_uuid}`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithSink_uuGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a sink, send a DELETE request to `/v2/monitoring/sinks/${sink_uuid}`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To get the details of a sink (resources and destination), send a GET request to `/v2/monitoring/sinks/${sink_uuid}`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSink_uuItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSink_uuItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuResponse.cs new file mode 100644 index 0000000..8cce97a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/Item/WithSink_uuResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item +{ + [Obsolete("This class is obsolete. Use WithSink_uuGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSink_uuResponse : global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksGetResponse.cs new file mode 100644 index 0000000..e1655a3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SinksGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// List of sinks identified by their URNs. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Sinks { get; set; } +#nullable restore +#else + public List Sinks { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SinksGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sinks", n => { Sinks = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Sinks_response.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("sinks", Sinks); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksPostRequestBody.cs new file mode 100644 index 0000000..34f9d72 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksPostRequestBody.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SinksPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A unique identifier for an already-existing destination. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DestinationUuid { get; set; } +#nullable restore +#else + public string DestinationUuid { get; set; } +#endif + /// List of resources identified by their URNs. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SinksPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "destination_uuid", n => { DestinationUuid = n.GetStringValue(); } }, + { "resources", n => { Resources = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Sink_resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("destination_uuid", DestinationUuid); + writer.WriteCollectionOfObjectValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksRequestBuilder.cs new file mode 100644 index 0000000..077705c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksRequestBuilder.cs @@ -0,0 +1,235 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks +{ + /// + /// Builds and executes requests for operations under \v2\monitoring\sinks + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SinksRequestBuilder : BaseRequestBuilder + { + /// The destinations property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsRequestBuilder Destinations + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Destinations.DestinationsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.monitoring.sinks.item collection + /// A unique identifier for a sink. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("sink_uuid", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.Item.WithSink_uuItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SinksRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks{?resource_id*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SinksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/monitoring/sinks{?resource_id*}", rawUrl) + { + } + /// + /// To list all sinks, send a GET request to `/v2/monitoring/sinks`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsSinksGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsSinksGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all sinks, send a GET request to `/v2/monitoring/sinks`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsSinksGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new sink, send a POST request to `/v2/monitoring/sinks`. Forwards logs from the resources identified in `resources` to the specified pre-existing destination. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all sinks, send a GET request to `/v2/monitoring/sinks`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new sink, send a POST request to `/v2/monitoring/sinks`. Forwards logs from the resources identified in `resources` to the specified pre-existing destination. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all sinks, send a GET request to `/v2/monitoring/sinks`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SinksRequestBuilderGetQueryParameters + { + /// A unique URN for a resource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("resource_id")] + public string? ResourceId { get; set; } +#nullable restore +#else + [QueryParameter("resource_id")] + public string ResourceId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SinksRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SinksRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksResponse.cs new file mode 100644 index 0000000..c3023b2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Monitoring/Sinks/SinksResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks +{ + [Obsolete("This class is obsolete. Use SinksGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SinksResponse : global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.Sinks.SinksResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/GetTypeQueryParameterType.cs b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/GetTypeQueryParameterType.cs new file mode 100644 index 0000000..f211434 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/GetTypeQueryParameterType.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.OneClicks +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum GetTypeQueryParameterType + #pragma warning restore CS1591 + { + [EnumMember(Value = "droplet")] + #pragma warning disable CS1591 + Droplet, + #pragma warning restore CS1591 + [EnumMember(Value = "kubernetes")] + #pragma warning disable CS1591 + Kubernetes, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesPostResponse.cs new file mode 100644 index 0000000..d29a08b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesPostResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class KubernetesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A message about the result of the request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public KubernetesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "message", n => { Message = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesRequestBuilder.cs new file mode 100644 index 0000000..71a5f39 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesRequestBuilder.cs @@ -0,0 +1,140 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes +{ + /// + /// Builds and executes requests for operations under \v2\1-clicks\kubernetes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KubernetesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public KubernetesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/1-clicks/kubernetes", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public KubernetesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/1-clicks/kubernetes", rawUrl) + { + } + /// + /// To install a Kubernetes 1-Click application on a cluster, send a POST request to`/v2/1-clicks/kubernetes`. The `addon_slugs` and `cluster_uuid` must be provided as bodyparameter in order to specify which 1-Click application(s) to install. To list all available1-Click Kubernetes applications, send a request to `/v2/1-clicks?type=kubernetes`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsKubernetesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsKubernetesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To install a Kubernetes 1-Click application on a cluster, send a POST request to`/v2/1-clicks/kubernetes`. The `addon_slugs` and `cluster_uuid` must be provided as bodyparameter in order to specify which 1-Click application(s) to install. To list all available1-Click Kubernetes applications, send a request to `/v2/1-clicks?type=kubernetes`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsKubernetesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To install a Kubernetes 1-Click application on a cluster, send a POST request to`/v2/1-clicks/kubernetes`. The `addon_slugs` and `cluster_uuid` must be provided as bodyparameter in order to specify which 1-Click application(s) to install. To list all available1-Click Kubernetes applications, send a request to `/v2/1-clicks?type=kubernetes`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.OneClicks_create body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class KubernetesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesResponse.cs new file mode 100644 index 0000000..0b2f79a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/Kubernetes/KubernetesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes +{ + [Obsolete("This class is obsolete. Use KubernetesPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class KubernetesResponse : global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksGetResponse.cs new file mode 100644 index 0000000..746653d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.OneClicks +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OneClicksGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The One_clicks property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? OneClicks { get; set; } +#nullable restore +#else + public List OneClicks { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OneClicksGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "1_clicks", n => { OneClicks = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.OneClicks.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("1_clicks", OneClicks); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksRequestBuilder.cs new file mode 100644 index 0000000..d5095b8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksRequestBuilder.cs @@ -0,0 +1,160 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.OneClicks +{ + /// + /// Builds and executes requests for operations under \v2\1-clicks + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OneClicksRequestBuilder : BaseRequestBuilder + { + /// The kubernetes property + public global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesRequestBuilder Kubernetes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.Kubernetes.KubernetesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OneClicksRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/1-clicks{?type*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OneClicksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/1-clicks{?type*}", rawUrl) + { + } + /// + /// To list all available 1-Click applications, send a GET request to `/v2/1-clicks`. The `type` maybe provided as query paramater in order to restrict results to a certain type of 1-Click, forexample: `/v2/1-clicks?type=droplet`. Current supported types are `kubernetes` and `droplet`.The response will be a JSON object with a key called `1_clicks`. This will be set to an array of1-Click application data, each of which will contain the the slug and type for the 1-Click. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsOneClicksGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsOneClicksGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all available 1-Click applications, send a GET request to `/v2/1-clicks`. The `type` maybe provided as query paramater in order to restrict results to a certain type of 1-Click, forexample: `/v2/1-clicks?type=droplet`. Current supported types are `kubernetes` and `droplet`.The response will be a JSON object with a key called `1_clicks`. This will be set to an array of1-Click application data, each of which will contain the the slug and type for the 1-Click. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsOneClicksGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all available 1-Click applications, send a GET request to `/v2/1-clicks`. The `type` maybe provided as query paramater in order to restrict results to a certain type of 1-Click, forexample: `/v2/1-clicks?type=droplet`. Current supported types are `kubernetes` and `droplet`.The response will be a JSON object with a key called `1_clicks`. This will be set to an array of1-Click application data, each of which will contain the the slug and type for the 1-Click. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all available 1-Click applications, send a GET request to `/v2/1-clicks`. The `type` maybe provided as query paramater in order to restrict results to a certain type of 1-Click, forexample: `/v2/1-clicks?type=droplet`. Current supported types are `kubernetes` and `droplet`.The response will be a JSON object with a key called `1_clicks`. This will be set to an array of1-Click application data, each of which will contain the the slug and type for the 1-Click. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OneClicksRequestBuilderGetQueryParameters + { + /// Restrict results to a certain type of 1-Click. + [Obsolete("This property is deprecated, use TypeAsGetTypeQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + /// Restrict results to a certain type of 1-Click. + [QueryParameter("type")] + public global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.GetTypeQueryParameterType? TypeAsGetTypeQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OneClicksRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksResponse.cs new file mode 100644 index 0000000..f1f7d52 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/OneClicks/OneClicksResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.OneClicks +{ + [Obsolete("This class is obsolete. Use OneClicksGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OneClicksResponse : global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultGetResponse.cs new file mode 100644 index 0000000..a75dc84 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DefaultGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The project property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Project? Project { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Project Project { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DefaultGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project", n => { Project = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("project", Project); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultPatchResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultPatchResponse.cs new file mode 100644 index 0000000..48ee6a8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultPatchResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DefaultPatchResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The project property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Project? Project { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Project Project { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DefaultPatchResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultPatchResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultPatchResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project", n => { Project = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("project", Project); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultPutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultPutResponse.cs new file mode 100644 index 0000000..d6f799f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultPutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DefaultPutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The project property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Project? Project { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Project Project { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DefaultPutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultPutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultPutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project", n => { Project = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("project", Project); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultRequestBuilder.cs new file mode 100644 index 0000000..4617504 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultRequestBuilder.cs @@ -0,0 +1,337 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default +{ + /// + /// Builds and executes requests for operations under \v2\projects\default + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DefaultRequestBuilder : BaseRequestBuilder + { + /// The resources property + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesRequestBuilder Resources + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/default", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/default", rawUrl) + { + } + /// + /// To get your default project, send a GET request to `/v2/projects/default`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDefaultGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDefaultGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get your default project, send a GET request to `/v2/projects/default`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDefaultGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update only specific attributes of your default project, send a PATCH request to `/v2/projects/default`. At least one of the following attributes needs to be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsDefaultPatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsDefaultPatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultPatchResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update only specific attributes of your default project, send a PATCH request to `/v2/projects/default`. At least one of the following attributes needs to be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PatchAsDefaultPatchResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update you default project, send a PUT request to `/v2/projects/default`. All of the following attributes must be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsDefaultPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsDefaultPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultPutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update you default project, send a PUT request to `/v2/projects/default`. All of the following attributes must be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsDefaultPutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get your default project, send a GET request to `/v2/projects/default`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update only specific attributes of your default project, send a PATCH request to `/v2/projects/default`. At least one of the following attributes needs to be sent. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To update you default project, send a PUT request to `/v2/projects/default`. All of the following attributes must be sent. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DefaultRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DefaultRequestBuilderPatchRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DefaultRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultResponse.cs new file mode 100644 index 0000000..8d0a99c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/DefaultResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default +{ + [Obsolete("This class is obsolete. Use DefaultGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DefaultResponse : global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesGetResponse.cs new file mode 100644 index 0000000..e7416f8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ResourcesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The resources property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourcesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "resources", n => { Resources = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesPostResponse.cs new file mode 100644 index 0000000..8a0dbfd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ResourcesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The resources property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourcesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "resources", n => { Resources = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesRequestBuilder.cs new file mode 100644 index 0000000..8490fa2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesRequestBuilder.cs @@ -0,0 +1,234 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources +{ + /// + /// Builds and executes requests for operations under \v2\projects\default\resources + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/default/resources", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ResourcesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/default/resources", rawUrl) + { + } + /// + /// To list all your resources in your default project, send a GET request to `/v2/projects/default/resources`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsResourcesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsResourcesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all your resources in your default project, send a GET request to `/v2/projects/default/resources`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsResourcesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To assign resources to your default project, send a POST request to `/v2/projects/default/resources`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsResourcesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsResourcesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To assign resources to your default project, send a POST request to `/v2/projects/default/resources`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsResourcesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all your resources in your default project, send a GET request to `/v2/projects/default/resources`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To assign resources to your default project, send a POST request to `/v2/projects/default/resources`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesResponse.cs new file mode 100644 index 0000000..1c39292 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Default/Resources/ResourcesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources +{ + [Obsolete("This class is obsolete. Use ResourcesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ResourcesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.Resources.ResourcesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesGetResponse.cs new file mode 100644 index 0000000..5c39748 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ResourcesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The resources property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourcesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "resources", n => { Resources = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesPostResponse.cs new file mode 100644 index 0000000..cf8997f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ResourcesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The resources property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Resources { get; set; } +#nullable restore +#else + public List Resources { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourcesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "resources", n => { Resources = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Resource.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("resources", Resources); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesRequestBuilder.cs new file mode 100644 index 0000000..7a1b87a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesRequestBuilder.cs @@ -0,0 +1,247 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources +{ + /// + /// Builds and executes requests for operations under \v2\projects\{project_id}\resources + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/{project_id}/resources{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ResourcesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/{project_id}/resources{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all your resources in a project, send a GET request to `/v2/projects/$PROJECT_ID/resources`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsResourcesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsResourcesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all your resources in a project, send a GET request to `/v2/projects/$PROJECT_ID/resources`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsResourcesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To assign resources to a project, send a POST request to `/v2/projects/$PROJECT_ID/resources`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsResourcesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsResourcesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To assign resources to a project, send a POST request to `/v2/projects/$PROJECT_ID/resources`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsResourcesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all your resources in a project, send a GET request to `/v2/projects/$PROJECT_ID/resources`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To assign resources to a project, send a POST request to `/v2/projects/$PROJECT_ID/resources`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project_assignment body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all your resources in a project, send a GET request to `/v2/projects/$PROJECT_ID/resources`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesResponse.cs new file mode 100644 index 0000000..37bd61a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/Resources/ResourcesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources +{ + [Obsolete("This class is obsolete. Use ResourcesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ResourcesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_GetResponse.cs new file mode 100644 index 0000000..2947ecd --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithProject_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The project property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Project? Project { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Project Project { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithProject_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project", n => { Project = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("project", Project); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_ItemRequestBuilder.cs new file mode 100644 index 0000000..8483eb7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_ItemRequestBuilder.cs @@ -0,0 +1,396 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item +{ + /// + /// Builds and executes requests for operations under \v2\projects\{project_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithProject_ItemRequestBuilder : BaseRequestBuilder + { + /// The resources property + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesRequestBuilder Resources + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithProject_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/{project_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithProject_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects/{project_id}", rawUrl) + { + } + /// + /// To delete a project, send a DELETE request to `/v2/projects/$PROJECT_ID`. Tobe deleted, a project must not have any resources assigned to it. Any existingresources must first be reassigned or destroyed, or you will receive a 412 error.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 412 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "412", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get a project, send a GET request to `/v2/projects/$PROJECT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithProject_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithProject_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get a project, send a GET request to `/v2/projects/$PROJECT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithProject_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update only specific attributes of a project, send a PATCH request to `/v2/projects/$PROJECT_ID`. At least one of the following attributes needs to be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsWithProject_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsWithProject_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_PatchResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update only specific attributes of a project, send a PATCH request to `/v2/projects/$PROJECT_ID`. At least one of the following attributes needs to be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PatchAsWithProject_PatchResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a project, send a PUT request to `/v2/projects/$PROJECT_ID`. All of the following attributes must be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithProject_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithProject_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a project, send a PUT request to `/v2/projects/$PROJECT_ID`. All of the following attributes must be sent. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithProject_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a project, send a DELETE request to `/v2/projects/$PROJECT_ID`. Tobe deleted, a project must not have any resources assigned to it. Any existingresources must first be reassigned or destroyed, or you will receive a 412 error.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To get a project, send a GET request to `/v2/projects/$PROJECT_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update only specific attributes of a project, send a PATCH request to `/v2/projects/$PROJECT_ID`. At least one of the following attributes needs to be sent. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To update a project, send a PUT request to `/v2/projects/$PROJECT_ID`. All of the following attributes must be sent. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithProject_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithProject_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithProject_ItemRequestBuilderPatchRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithProject_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_PatchResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_PatchResponse.cs new file mode 100644 index 0000000..ed9ae76 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_PatchResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithProject_PatchResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The project property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Project? Project { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Project Project { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithProject_PatchResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_PatchResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_PatchResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project", n => { Project = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("project", Project); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_PutResponse.cs new file mode 100644 index 0000000..1b58c4a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithProject_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The project property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Project? Project { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Project Project { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithProject_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project", n => { Project = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("project", Project); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_Response.cs new file mode 100644 index 0000000..7c285aa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/Item/WithProject_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects.Item +{ + [Obsolete("This class is obsolete. Use WithProject_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithProject_Response : global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsGetResponse.cs new file mode 100644 index 0000000..ff8b270 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ProjectsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The projects property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Projects { get; set; } +#nullable restore +#else + public List Projects { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ProjectsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "projects", n => { Projects = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("projects", Projects); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsPostResponse.cs new file mode 100644 index 0000000..a27c01d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ProjectsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The project property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Project? Project { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Project Project { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ProjectsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "project", n => { Project = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Project.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("project", Project); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsRequestBuilder.cs new file mode 100644 index 0000000..f1b0786 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsRequestBuilder.cs @@ -0,0 +1,271 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Projects.Default; +using InfinityFlow.DigitalOcean.Client.V2.Projects.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects +{ + /// + /// Builds and executes requests for operations under \v2\projects + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ProjectsRequestBuilder : BaseRequestBuilder + { + /// The default property + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultRequestBuilder Default + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Default.DefaultRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.projects.item collection + /// A unique identifier for a project. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("project_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.projects.item collection + /// A unique identifier for a project. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("project_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.Item.WithProject_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProjectsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProjectsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/projects{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all your projects, send a GET request to `/v2/projects`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsProjectsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsProjectsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all your projects, send a GET request to `/v2/projects`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsProjectsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a project, send a POST request to `/v2/projects`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsProjectsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_base body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsProjectsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_base body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a project, send a POST request to `/v2/projects`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsProjectsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_base body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Project_base body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all your projects, send a GET request to `/v2/projects`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a project, send a POST request to `/v2/projects`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project_base body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Project_base body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all your projects, send a GET request to `/v2/projects`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ProjectsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ProjectsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ProjectsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsResponse.cs new file mode 100644 index 0000000..4997ca5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Projects/ProjectsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Projects +{ + [Obsolete("This class is obsolete. Use ProjectsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ProjectsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsGetResponse.cs new file mode 100644 index 0000000..b22cc40 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Regions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RegionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The regions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Regions { get; set; } +#nullable restore +#else + public List Regions { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RegionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "regions", n => { Regions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Region.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("regions", Regions); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsRequestBuilder.cs new file mode 100644 index 0000000..c7ffa6b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsRequestBuilder.cs @@ -0,0 +1,146 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Regions +{ + /// + /// Builds and executes requests for operations under \v2\regions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RegionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/regions{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RegionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/regions{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the regions that are available, send a GET request to `/v2/regions`.The response will be a JSON object with a key called `regions`. The value of this will be an array of `region` objects, each of which will contain the standard region attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsRegionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsRegionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the regions that are available, send a GET request to `/v2/regions`.The response will be a JSON object with a key called `regions`. The value of this will be an array of `region` objects, each of which will contain the standard region attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsRegionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the regions that are available, send a GET request to `/v2/regions`.The response will be a JSON object with a key called `regions`. The value of this will be an array of `region` objects, each of which will contain the standard region attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the regions that are available, send a GET request to `/v2/regions`.The response will be a JSON object with a key called `regions`. The value of this will be an array of `region` objects, each of which will contain the standard region attributes. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegionsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsResponse.cs new file mode 100644 index 0000000..3326045 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Regions/RegionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Regions +{ + [Obsolete("This class is obsolete. Use RegionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RegionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/DockerCredentials/DockerCredentialsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/DockerCredentials/DockerCredentialsRequestBuilder.cs new file mode 100644 index 0000000..1dd728c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/DockerCredentials/DockerCredentialsRequestBuilder.cs @@ -0,0 +1,116 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.DockerCredentials +{ + /// + /// Builds and executes requests for operations under \v2\registry\docker-credentials + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DockerCredentialsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DockerCredentialsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/docker-credentials{?expiry_seconds*,read_write*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DockerCredentialsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/docker-credentials{?expiry_seconds*,read_write*}", rawUrl) + { + } + /// + /// In order to access your container registry with the Docker client or from aKubernetes cluster, you will need to configure authentication. The necessaryJSON configuration can be retrieved by sending a GET request to`/v2/registry/docker-credentials`.The response will be in the format of a Docker `config.json` file. To use theconfig in your Kubernetes cluster, create a Secret with: kubectl create secret generic docr \ --from-file=.dockerconfigjson=config.json \ --type=kubernetes.io/dockerconfigjsonBy default, the returned credentials have read-only access to your registryand cannot be used to push images. This is appropriate for most Kubernetesclusters. To retrieve read/write credentials, suitable for use with the Dockerclient or in a CI system, read_write may be provided as query parameter. Forexample: `/v2/registry/docker-credentials?read_write=true`By default, the returned credentials will not expire. To retrieve credentialswith an expiry set, expiry_seconds may be provided as a query parameter. Forexample: `/v2/registry/docker-credentials?expiry_seconds=3600` will returncredentials that expire after one hour. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Docker_credentials.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// In order to access your container registry with the Docker client or from aKubernetes cluster, you will need to configure authentication. The necessaryJSON configuration can be retrieved by sending a GET request to`/v2/registry/docker-credentials`.The response will be in the format of a Docker `config.json` file. To use theconfig in your Kubernetes cluster, create a Secret with: kubectl create secret generic docr \ --from-file=.dockerconfigjson=config.json \ --type=kubernetes.io/dockerconfigjsonBy default, the returned credentials have read-only access to your registryand cannot be used to push images. This is appropriate for most Kubernetesclusters. To retrieve read/write credentials, suitable for use with the Dockerclient or in a CI system, read_write may be provided as query parameter. Forexample: `/v2/registry/docker-credentials?read_write=true`By default, the returned credentials will not expire. To retrieve credentialswith an expiry set, expiry_seconds may be provided as a query parameter. Forexample: `/v2/registry/docker-credentials?expiry_seconds=3600` will returncredentials that expire after one hour. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.DockerCredentials.DockerCredentialsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.DockerCredentials.DockerCredentialsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// In order to access your container registry with the Docker client or from aKubernetes cluster, you will need to configure authentication. The necessaryJSON configuration can be retrieved by sending a GET request to`/v2/registry/docker-credentials`.The response will be in the format of a Docker `config.json` file. To use theconfig in your Kubernetes cluster, create a Secret with: kubectl create secret generic docr \ --from-file=.dockerconfigjson=config.json \ --type=kubernetes.io/dockerconfigjsonBy default, the returned credentials have read-only access to your registryand cannot be used to push images. This is appropriate for most Kubernetesclusters. To retrieve read/write credentials, suitable for use with the Dockerclient or in a CI system, read_write may be provided as query parameter. Forexample: `/v2/registry/docker-credentials?read_write=true`By default, the returned credentials will not expire. To retrieve credentialswith an expiry set, expiry_seconds may be provided as a query parameter. Forexample: `/v2/registry/docker-credentials?expiry_seconds=3600` will returncredentials that expire after one hour. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DockerCredentialsRequestBuilderGetQueryParameters + { + /// The duration in seconds that the returned registry credentials will be valid. If not set or 0, the credentials will not expire. + [QueryParameter("expiry_seconds")] + public int? ExpirySeconds { get; set; } + /// By default, the registry credentials allow for read-only access. Set this query parameter to `true` to obtain read-write credentials. + [QueryParameter("read_write")] + public bool? ReadWrite { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DockerCredentialsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionGetResponse.cs new file mode 100644 index 0000000..3dd4dfa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class GarbageCollectionGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The garbage_collection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection? GarbageCollection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection GarbageCollection { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GarbageCollectionGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "garbage_collection", n => { GarbageCollection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("garbage_collection", GarbageCollection); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionPostResponse.cs new file mode 100644 index 0000000..b2d0574 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class GarbageCollectionPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The garbage_collection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection? GarbageCollection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection GarbageCollection { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GarbageCollectionPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "garbage_collection", n => { GarbageCollection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("garbage_collection", GarbageCollection); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionRequestBuilder.cs new file mode 100644 index 0000000..a445dd9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionRequestBuilder.cs @@ -0,0 +1,240 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\garbage-collection + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GarbageCollectionRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.registry.item.garbageCollection.item collection + /// The UUID of a garbage collection run. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("garbage_collection_uuid", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GarbageCollectionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/garbage-collection", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GarbageCollectionRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/garbage-collection", rawUrl) + { + } + /// + /// To get information about the currently-active garbage collection for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collection`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsGarbageCollectionGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsGarbageCollectionGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about the currently-active garbage collection for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collection`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsGarbageCollectionGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Garbage collection enables users to clear out unreferenced blobs (layer &manifest data) after deleting one or more manifests from a repository. Ifthere are no unreferenced blobs resulting from the deletion of one or moremanifests, garbage collection is effectively a noop.[See here for more information](https://docs.digitalocean.com/products/container-registry/how-to/clean-up-container-registry/)about how and why you should clean up your container registry periodically.To request a garbage collection run on your registry, send a POST request to`/v2/registry/$REGISTRY_NAME/garbage-collection`. This will initiate thefollowing sequence of events on your registry.* Set the registry to read-only mode, meaning no further write-scoped JWTs will be issued to registry clients. Existing write-scoped JWTs will continue to work until they expire which can take up to 15 minutes.* Wait until all existing write-scoped JWTs have expired.* Scan all registry manifests to determine which blobs are unreferenced.* Delete all unreferenced blobs from the registry.* Record the number of blobs deleted and bytes freed, mark the garbage collection status as `success`.* Remove the read-only mode restriction from the registry, meaning write-scoped JWTs will once again be issued to registry clients. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsGarbageCollectionPostResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsGarbageCollectionPostResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Garbage collection enables users to clear out unreferenced blobs (layer &manifest data) after deleting one or more manifests from a repository. Ifthere are no unreferenced blobs resulting from the deletion of one or moremanifests, garbage collection is effectively a noop.[See here for more information](https://docs.digitalocean.com/products/container-registry/how-to/clean-up-container-registry/)about how and why you should clean up your container registry periodically.To request a garbage collection run on your registry, send a POST request to`/v2/registry/$REGISTRY_NAME/garbage-collection`. This will initiate thefollowing sequence of events on your registry.* Set the registry to read-only mode, meaning no further write-scoped JWTs will be issued to registry clients. Existing write-scoped JWTs will continue to work until they expire which can take up to 15 minutes.* Wait until all existing write-scoped JWTs have expired.* Scan all registry manifests to determine which blobs are unreferenced.* Delete all unreferenced blobs from the registry.* Record the number of blobs deleted and bytes freed, mark the garbage collection status as `success`.* Remove the read-only mode restriction from the registry, meaning write-scoped JWTs will once again be issued to registry clients. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsGarbageCollectionPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about the currently-active garbage collection for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collection`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Garbage collection enables users to clear out unreferenced blobs (layer &manifest data) after deleting one or more manifests from a repository. Ifthere are no unreferenced blobs resulting from the deletion of one or moremanifests, garbage collection is effectively a noop.[See here for more information](https://docs.digitalocean.com/products/container-registry/how-to/clean-up-container-registry/)about how and why you should clean up your container registry periodically.To request a garbage collection run on your registry, send a POST request to`/v2/registry/$REGISTRY_NAME/garbage-collection`. This will initiate thefollowing sequence of events on your registry.* Set the registry to read-only mode, meaning no further write-scoped JWTs will be issued to registry clients. Existing write-scoped JWTs will continue to work until they expire which can take up to 15 minutes.* Wait until all existing write-scoped JWTs have expired.* Scan all registry manifests to determine which blobs are unreferenced.* Delete all unreferenced blobs from the registry.* Record the number of blobs deleted and bytes freed, mark the garbage collection status as `success`.* Remove the read-only mode restriction from the registry, meaning write-scoped JWTs will once again be issued to registry clients. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GarbageCollectionRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GarbageCollectionRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionResponse.cs new file mode 100644 index 0000000..0939d45 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/GarbageCollectionResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection +{ + [Obsolete("This class is obsolete. Use GarbageCollectionPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class GarbageCollectionResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuItemRequestBuilder.cs new file mode 100644 index 0000000..3c3c985 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuItemRequestBuilder.cs @@ -0,0 +1,144 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\garbage-collection\{garbage_collection_uuid} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithGarbage_collection_uuItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithGarbage_collection_uuItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/garbage-collection/{garbage_collection_uuid}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithGarbage_collection_uuItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/garbage-collection/{garbage_collection_uuid}", rawUrl) + { + } + /// + /// To cancel the currently-active garbage collection for a registry, send a PUT request to `/v2/registry/$REGISTRY_NAME/garbage-collection/$GC_UUID` and specify one or more of the attributes below. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithGarbage_collection_uuPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_registry body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithGarbage_collection_uuPutResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_registry body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuPutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To cancel the currently-active garbage collection for a registry, send a PUT request to `/v2/registry/$REGISTRY_NAME/garbage-collection/$GC_UUID` and specify one or more of the attributes below. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithGarbage_collection_uuPutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_registry body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.Models.Update_registry body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To cancel the currently-active garbage collection for a registry, send a PUT request to `/v2/registry/$REGISTRY_NAME/garbage-collection/$GC_UUID` and specify one or more of the attributes below. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Update_registry body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Update_registry body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithGarbage_collection_uuItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuPutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuPutResponse.cs new file mode 100644 index 0000000..fed8ad6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuPutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithGarbage_collection_uuPutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The garbage_collection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection? GarbageCollection { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection GarbageCollection { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithGarbage_collection_uuPutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuPutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuPutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "garbage_collection", n => { GarbageCollection = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("garbage_collection", GarbageCollection); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuResponse.cs new file mode 100644 index 0000000..527c2c0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollection/Item/WithGarbage_collection_uuResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item +{ + [Obsolete("This class is obsolete. Use WithGarbage_collection_uuPutResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithGarbage_collection_uuResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuPutResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.Item.WithGarbage_collection_uuResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsGetResponse.cs new file mode 100644 index 0000000..4d61952 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class GarbageCollectionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The garbage_collections property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? GarbageCollections { get; set; } +#nullable restore +#else + public List GarbageCollections { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GarbageCollectionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "garbage_collections", n => { GarbageCollections = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Garbage_collection.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("garbage_collections", GarbageCollections); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsRequestBuilder.cs new file mode 100644 index 0000000..5d9bb5b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\garbage-collections + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GarbageCollectionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GarbageCollectionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/garbage-collections{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GarbageCollectionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/garbage-collections{?page*,per_page*}", rawUrl) + { + } + /// + /// To get information about past garbage collections for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collections`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsGarbageCollectionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsGarbageCollectionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about past garbage collections for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collections`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsGarbageCollectionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about past garbage collections for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collections`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To get information about past garbage collections for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collections`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GarbageCollectionsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GarbageCollectionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsResponse.cs new file mode 100644 index 0000000..915d92e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/GarbageCollections/GarbageCollectionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections +{ + [Obsolete("This class is obsolete. Use GarbageCollectionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class GarbageCollectionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsGetResponse.cs new file mode 100644 index 0000000..f7f4afa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DigestsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The manifests property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Manifests { get; set; } +#nullable restore +#else + public List Manifests { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DigestsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "manifests", n => { Manifests = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Repository_manifest.CreateFromDiscriminatorValue)?.AsList(); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteCollectionOfObjectValues("manifests", Manifests); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsRequestBuilder.cs new file mode 100644 index 0000000..e87d9b9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsRequestBuilder.cs @@ -0,0 +1,163 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\repositories\{repository_name}\digests + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DigestsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.registry.item.repositories.item.digests.item collection + /// The manifest digest of a container registry repository tag. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.Item.WithManifest_digestItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("manifest_digest", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.Item.WithManifest_digestItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DigestsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/digests{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DigestsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/digests{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all manifests in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list manifests for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/digests`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsDigestsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsDigestsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all manifests in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list manifests for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/digests`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsDigestsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all manifests in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list manifests for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/digests`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all manifests in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list manifests for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/digests`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DigestsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DigestsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsResponse.cs new file mode 100644 index 0000000..9dcae22 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/DigestsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests +{ + [Obsolete("This class is obsolete. Use DigestsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class DigestsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/Item/WithManifest_digestItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/Item/WithManifest_digestItemRequestBuilder.cs new file mode 100644 index 0000000..0b2cb28 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Digests/Item/WithManifest_digestItemRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.Item +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\repositories\{repository_name}\digests\{manifest_digest} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithManifest_digestItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithManifest_digestItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/digests/{manifest_digest}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithManifest_digestItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/digests/{manifest_digest}", rawUrl) + { + } + /// + /// To delete a container repository manifest by digest, send a DELETE request to`/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests/$MANIFEST_DIGEST`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to delete`registry.digitalocean.com/example/my/repo@sha256:abcd`, the path would be`/v2/registry/example/repositories/my%2Frepo/digests/sha256:abcd`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a container repository manifest by digest, send a DELETE request to`/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests/$MANIFEST_DIGEST`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to delete`registry.digitalocean.com/example/my/repo@sha256:abcd`, the path would be`/v2/registry/example/repositories/my%2Frepo/digests/sha256:abcd`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.Item.WithManifest_digestItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.Item.WithManifest_digestItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithManifest_digestItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/Item/WithRepository_tagItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/Item/WithRepository_tagItemRequestBuilder.cs new file mode 100644 index 0000000..efa987f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/Item/WithRepository_tagItemRequestBuilder.cs @@ -0,0 +1,104 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.Item +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\repositories\{repository_name}\tags\{repository_tag} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithRepository_tagItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRepository_tagItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/tags/{repository_tag}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithRepository_tagItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/tags/{repository_tag}", rawUrl) + { + } + /// + /// To delete a container repository tag, send a DELETE request to`/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags/$TAG`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to delete`registry.digitalocean.com/example/my/repo:mytag`, the path would be`/v2/registry/example/repositories/my%2Frepo/tags/mytag`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a container repository tag, send a DELETE request to`/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags/$TAG`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to delete`registry.digitalocean.com/example/my/repo:mytag`, the path would be`/v2/registry/example/repositories/my%2Frepo/tags/mytag`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.Item.WithRepository_tagItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.Item.WithRepository_tagItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithRepository_tagItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsGetResponse.cs new file mode 100644 index 0000000..d48418e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TagsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TagsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "tags", n => { Tags = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Repository_tag.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsRequestBuilder.cs new file mode 100644 index 0000000..18fe2d1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsRequestBuilder.cs @@ -0,0 +1,163 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\repositories\{repository_name}\tags + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.registry.item.repositories.item.tags.item collection + /// The name of a container registry repository tag. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.Item.WithRepository_tagItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("repository_tag", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.Item.WithRepository_tagItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TagsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/tags{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}/tags{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all tags in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list tags for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/tags`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsTagsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsTagsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all tags in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list tags for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/tags`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsTagsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all tags in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list tags for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/tags`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all tags in your container registry repository, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags`.Note that if your repository name contains `/` characters, it must beURL-encoded in the request URL. For example, to list tags for`registry.digitalocean.com/example/my/repo`, the path would be`/v2/registry/example/repositories/my%2Frepo/tags`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsResponse.cs new file mode 100644 index 0000000..9ecfda3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/Tags/TagsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags +{ + [Obsolete("This class is obsolete. Use TagsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TagsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/WithRepository_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/WithRepository_nameItemRequestBuilder.cs new file mode 100644 index 0000000..5826680 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/Item/WithRepository_nameItemRequestBuilder.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\repositories\{repository_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithRepository_nameItemRequestBuilder : BaseRequestBuilder + { + /// The digests property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsRequestBuilder Digests + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Digests.DigestsRequestBuilder(PathParameters, RequestAdapter); + } + /// The tags property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsRequestBuilder Tags + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.Tags.TagsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRepository_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithRepository_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories/{repository_name}", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesGetResponse.cs new file mode 100644 index 0000000..172eee0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RepositoriesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The repositories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Repositories { get; set; } +#nullable restore +#else + public List Repositories { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RepositoriesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "repositories", n => { Repositories = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Repository.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("repositories", Repositories); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesRequestBuilder.cs new file mode 100644 index 0000000..1aad355 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesRequestBuilder.cs @@ -0,0 +1,166 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\repositories + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RepositoriesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.registry.item.repositories.item collection + /// The name of a container registry repository. If the name contains `/` characters, they must be URL-encoded, e.g. `%2F`. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.WithRepository_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("repository_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.Item.WithRepository_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RepositoriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RepositoriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositories{?page*,per_page*}", rawUrl) + { + } + /// + /// This endpoint has been deprecated in favor of the _List All Container Registry Repositories [V2]_ endpoint.To list all repositories in your container registry, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsRepositoriesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsRepositoriesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This endpoint has been deprecated in favor of the _List All Container Registry Repositories [V2]_ endpoint.To list all repositories in your container registry, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsRepositoriesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This endpoint has been deprecated in favor of the _List All Container Registry Repositories [V2]_ endpoint.To list all repositories in your container registry, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + [Obsolete("")] + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// This endpoint has been deprecated in favor of the _List All Container Registry Repositories [V2]_ endpoint.To list all repositories in your container registry, send a GETrequest to `/v2/registry/$REGISTRY_NAME/repositories`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RepositoriesRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RepositoriesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesResponse.cs new file mode 100644 index 0000000..02439ba --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/Repositories/RepositoriesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories +{ + [Obsolete("This class is obsolete. Use RepositoriesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RepositoriesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2GetResponse.cs new file mode 100644 index 0000000..3331cce --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2GetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2 +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RepositoriesV2GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The repositories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Repositories { get; set; } +#nullable restore +#else + public List Repositories { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RepositoriesV2GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "repositories", n => { Repositories = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Repository_v2.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("repositories", Repositories); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2RequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2RequestBuilder.cs new file mode 100644 index 0000000..64e53be --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2RequestBuilder.cs @@ -0,0 +1,164 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2 +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name}\repositoriesV2 + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RepositoriesV2RequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RepositoriesV2RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositoriesV2{?page*,page_token*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RepositoriesV2RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}/repositoriesV2{?page*,page_token*,per_page*}", rawUrl) + { + } + /// + /// To list all repositories in your container registry, send a GET request to `/v2/registry/$REGISTRY_NAME/repositoriesV2`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsRepositoriesV2GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsRepositoriesV2GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all repositories in your container registry, send a GET request to `/v2/registry/$REGISTRY_NAME/repositoriesV2`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsRepositoriesV2GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all repositories in your container registry, send a GET request to `/v2/registry/$REGISTRY_NAME/repositoriesV2`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2RequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all repositories in your container registry, send a GET request to `/v2/registry/$REGISTRY_NAME/repositoriesV2`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RepositoriesV2RequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. Ignored when 'page_token' is provided. + [QueryParameter("page")] + public int? Page { get; set; } + /// Token to retrieve of the next or previous set of results more quickly than using 'page'. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("page_token")] + public string? PageToken { get; set; } +#nullable restore +#else + [QueryParameter("page_token")] + public string PageToken { get; set; } +#endif + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RepositoriesV2RequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2Response.cs new file mode 100644 index 0000000..acfdc9f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/RepositoriesV2/RepositoriesV2Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2 +{ + [Obsolete("This class is obsolete. Use RepositoriesV2GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RepositoriesV2Response : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/WithRegistry_nameItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/WithRegistry_nameItemRequestBuilder.cs new file mode 100644 index 0000000..8b8033f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Item/WithRegistry_nameItemRequestBuilder.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Item +{ + /// + /// Builds and executes requests for operations under \v2\registry\{registry_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithRegistry_nameItemRequestBuilder : BaseRequestBuilder + { + /// The garbageCollection property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionRequestBuilder GarbageCollection + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollection.GarbageCollectionRequestBuilder(PathParameters, RequestAdapter); + } + /// The garbageCollections property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsRequestBuilder GarbageCollections + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.GarbageCollections.GarbageCollectionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The repositories property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesRequestBuilder Repositories + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.Repositories.RepositoriesRequestBuilder(PathParameters, RequestAdapter); + } + /// The repositoriesV2 property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2RequestBuilder RepositoriesV2 + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.RepositoriesV2.RepositoriesV2RequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRegistry_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithRegistry_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/{registry_name}", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse.cs new file mode 100644 index 0000000..920eb8f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Options +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OptionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The options property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options? Options { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options Options { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OptionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "options", n => { Options = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("options", Options); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options.cs new file mode 100644 index 0000000..8b53ce0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Options +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OptionsGetResponse_options : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The available_regions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AvailableRegions { get; set; } +#nullable restore +#else + public List AvailableRegions { get; set; } +#endif + /// The subscription_tiers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SubscriptionTiers { get; set; } +#nullable restore +#else + public List SubscriptionTiers { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OptionsGetResponse_options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "available_regions", n => { AvailableRegions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "subscription_tiers", n => { SubscriptionTiers = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options_subscription_tiers.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("available_regions", AvailableRegions); + writer.WriteCollectionOfObjectValues("subscription_tiers", SubscriptionTiers); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options_subscription_tiers.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options_subscription_tiers.cs new file mode 100644 index 0000000..1750578 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options_subscription_tiers.cs @@ -0,0 +1,113 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Options +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OptionsGetResponse_options_subscription_tiers : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean indicating whether the subscription tier supports additional storage above what is included in the base plan at an additional cost per GiB used. + public bool? AllowStorageOverage { get; set; } + /// If your account is not eligible to use a certain subscription tier, this will include a list of reasons that prevent you from using the tier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EligibilityReasons { get; set; } +#nullable restore +#else + public List EligibilityReasons { get; set; } +#endif + /// A boolean indicating whether your account it eligible to use a certain subscription tier. + public bool? Eligible { get; set; } + /// The amount of outbound data transfer included in the subscription tier in bytes. + public int? IncludedBandwidthBytes { get; set; } + /// The number of repositories included in the subscription tier. `0` indicates that the subscription tier includes unlimited repositories. + public int? IncludedRepositories { get; set; } + /// The amount of storage included in the subscription tier in bytes. + public int? IncludedStorageBytes { get; set; } + /// The monthly cost of the subscription tier in cents. + public int? MonthlyPriceInCents { get; set; } + /// The name of the subscription tier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The slug identifier of the subscription tier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Slug { get; set; } +#nullable restore +#else + public string Slug { get; set; } +#endif + /// The price paid in cents per GiB for additional storage beyond what is included in the subscription plan. + public int? StorageOveragePriceInCents { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public OptionsGetResponse_options_subscription_tiers() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options_subscription_tiers CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse_options_subscription_tiers(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allow_storage_overage", n => { AllowStorageOverage = n.GetBoolValue(); } }, + { "eligibility_reasons", n => { EligibilityReasons = n.GetCollectionOfEnumValues()?.AsList(); } }, + { "eligible", n => { Eligible = n.GetBoolValue(); } }, + { "included_bandwidth_bytes", n => { IncludedBandwidthBytes = n.GetIntValue(); } }, + { "included_repositories", n => { IncludedRepositories = n.GetIntValue(); } }, + { "included_storage_bytes", n => { IncludedStorageBytes = n.GetIntValue(); } }, + { "monthly_price_in_cents", n => { MonthlyPriceInCents = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "slug", n => { Slug = n.GetStringValue(); } }, + { "storage_overage_price_in_cents", n => { StorageOveragePriceInCents = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("allow_storage_overage", AllowStorageOverage); + writer.WriteCollectionOfEnumValues("eligibility_reasons", EligibilityReasons); + writer.WriteBoolValue("eligible", Eligible); + writer.WriteIntValue("included_bandwidth_bytes", IncludedBandwidthBytes); + writer.WriteIntValue("included_repositories", IncludedRepositories); + writer.WriteIntValue("included_storage_bytes", IncludedStorageBytes); + writer.WriteIntValue("monthly_price_in_cents", MonthlyPriceInCents); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("slug", Slug); + writer.WriteIntValue("storage_overage_price_in_cents", StorageOveragePriceInCents); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options_subscription_tiers_eligibility_reasons.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options_subscription_tiers_eligibility_reasons.cs new file mode 100644 index 0000000..7460734 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsGetResponse_options_subscription_tiers_eligibility_reasons.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Options +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum OptionsGetResponse_options_subscription_tiers_eligibility_reasons + #pragma warning restore CS1591 + { + [EnumMember(Value = "OverRepositoryLimit")] + #pragma warning disable CS1591 + OverRepositoryLimit, + #pragma warning restore CS1591 + [EnumMember(Value = "OverStorageLimit")] + #pragma warning disable CS1591 + OverStorageLimit, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsRequestBuilder.cs new file mode 100644 index 0000000..b059e1c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsRequestBuilder.cs @@ -0,0 +1,133 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Options +{ + /// + /// Builds and executes requests for operations under \v2\registry\options + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OptionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/options", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/options", rawUrl) + { + } + /// + /// This endpoint serves to provide additional information as to which option values are available when creating a container registry.There are multiple subscription tiers available for container registry. Each tier allows a different number of image repositories to be created in your registry, and has a different amount of storage and transfer included.There are multiple regions available for container registry and controls where your data is stored.To list the available options, send a GET request to `/v2/registry/options`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsOptionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsOptionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This endpoint serves to provide additional information as to which option values are available when creating a container registry.There are multiple subscription tiers available for container registry. Each tier allows a different number of image repositories to be created in your registry, and has a different amount of storage and transfer included.There are multiple regions available for container registry and controls where your data is stored.To list the available options, send a GET request to `/v2/registry/options`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsOptionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// This endpoint serves to provide additional information as to which option values are available when creating a container registry.There are multiple subscription tiers available for container registry. Each tier allows a different number of image repositories to be created in your registry, and has a different amount of storage and transfer included.There are multiple regions available for container registry and controls where your data is stored.To list the available options, send a GET request to `/v2/registry/options`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class OptionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsResponse.cs new file mode 100644 index 0000000..664a7ab --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Options/OptionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Options +{ + [Obsolete("This class is obsolete. Use OptionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class OptionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryGetResponse.cs new file mode 100644 index 0000000..0340394 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RegistryGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The registry property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Registry? Registry { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Registry Registry { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RegistryGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "registry", n => { Registry = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Registry.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("registry", Registry); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryPostResponse.cs new file mode 100644 index 0000000..40e738a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RegistryPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The registry property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Registry? Registry { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Registry Registry { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RegistryPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "registry", n => { Registry = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Registry.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("registry", Registry); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryRequestBuilder.cs new file mode 100644 index 0000000..9f7fec2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryRequestBuilder.cs @@ -0,0 +1,320 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Registry.DockerCredentials; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Item; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Options; +using InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription; +using InfinityFlow.DigitalOcean.Client.V2.Registry.ValidateName; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry +{ + /// + /// Builds and executes requests for operations under \v2\registry + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegistryRequestBuilder : BaseRequestBuilder + { + /// The dockerCredentials property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.DockerCredentials.DockerCredentialsRequestBuilder DockerCredentials + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.DockerCredentials.DockerCredentialsRequestBuilder(PathParameters, RequestAdapter); + } + /// The optionsPath property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsRequestBuilder OptionsPath + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Options.OptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The subscription property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionRequestBuilder Subscription + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionRequestBuilder(PathParameters, RequestAdapter); + } + /// The validateName property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.ValidateName.ValidateNameRequestBuilder ValidateName + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.ValidateName.ValidateNameRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.registry.item collection + /// The name of a container registry. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.WithRegistry_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("registry_name", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Item.WithRegistry_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RegistryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RegistryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry", rawUrl) + { + } + /// + /// To delete your container registry, destroying all container image data stored in it, send a DELETE request to `/v2/registry`. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about your container registry, send a GET request to `/v2/registry`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsRegistryGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsRegistryGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To get information about your container registry, send a GET request to `/v2/registry`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsRegistryGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create your container registry, send a POST request to `/v2/registry`.The `name` becomes part of the URL for images stored in the registry. Forexample, if your registry is called `example`, an image in it will have theURL `registry.digitalocean.com/example/image:tag`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsRegistryPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Registry_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsRegistryPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Registry_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create your container registry, send a POST request to `/v2/registry`.The `name` becomes part of the URL for images stored in the registry. Forexample, if your registry is called `example`, an image in it will have theURL `registry.digitalocean.com/example/image:tag`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsRegistryPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Registry_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Registry_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete your container registry, destroying all container image data stored in it, send a DELETE request to `/v2/registry`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To get information about your container registry, send a GET request to `/v2/registry`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create your container registry, send a POST request to `/v2/registry`.The `name` becomes part of the URL for images stored in the registry. Forexample, if your registry is called `example`, an image in it will have theURL `registry.digitalocean.com/example/image:tag`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Registry_create body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Registry_create body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegistryRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegistryRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class RegistryRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryResponse.cs new file mode 100644 index 0000000..e2e40db --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/RegistryResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry +{ + [Obsolete("This class is obsolete. Use RegistryGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class RegistryResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionGetResponse.cs new file mode 100644 index 0000000..c187c15 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SubscriptionGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The subscription property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription? Subscription { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription Subscription { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SubscriptionGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "subscription", n => { Subscription = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Subscription.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("subscription", Subscription); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostRequestBody.cs new file mode 100644 index 0000000..2725b13 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostRequestBody.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SubscriptionPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The slug of the subscription tier to sign up for. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody_tier_slug? TierSlug { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public SubscriptionPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "tier_slug", n => { TierSlug = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("tier_slug", TierSlug); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostRequestBody_tier_slug.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostRequestBody_tier_slug.cs new file mode 100644 index 0000000..d32e864 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostRequestBody_tier_slug.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription +{ + /// The slug of the subscription tier to sign up for. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public enum SubscriptionPostRequestBody_tier_slug + { + [EnumMember(Value = "starter")] + #pragma warning disable CS1591 + Starter, + #pragma warning restore CS1591 + [EnumMember(Value = "basic")] + #pragma warning disable CS1591 + Basic, + #pragma warning restore CS1591 + [EnumMember(Value = "professional")] + #pragma warning disable CS1591 + Professional, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostResponse.cs new file mode 100644 index 0000000..ba830ce --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SubscriptionPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The subscription property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription? Subscription { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Subscription Subscription { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SubscriptionPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "subscription", n => { Subscription = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Subscription.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("subscription", Subscription); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionRequestBuilder.cs new file mode 100644 index 0000000..42fd39e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionRequestBuilder.cs @@ -0,0 +1,226 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription +{ + /// + /// Builds and executes requests for operations under \v2\registry\subscription + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SubscriptionRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubscriptionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/subscription", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubscriptionRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/subscription", rawUrl) + { + } + /// + /// A subscription is automatically created when you configure your container registry. To get information about your subscription, send a GET request to `/v2/registry/subscription`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsSubscriptionGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsSubscriptionGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// A subscription is automatically created when you configure your container registry. To get information about your subscription, send a GET request to `/v2/registry/subscription`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsSubscriptionGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to `/v2/registry/subscription`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsSubscriptionPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsSubscriptionPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to `/v2/registry/subscription`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsSubscriptionPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// A subscription is automatically created when you configure your container registry. To get information about your subscription, send a GET request to `/v2/registry/subscription`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to `/v2/registry/subscription`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SubscriptionRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SubscriptionRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionResponse.cs new file mode 100644 index 0000000..eb0114b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/Subscription/SubscriptionResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription +{ + [Obsolete("This class is obsolete. Use SubscriptionGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SubscriptionResponse : global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.Subscription.SubscriptionResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Registry/ValidateName/ValidateNameRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/ValidateName/ValidateNameRequestBuilder.cs new file mode 100644 index 0000000..3df415c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Registry/ValidateName/ValidateNameRequestBuilder.cs @@ -0,0 +1,109 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Registry.ValidateName +{ + /// + /// Builds and executes requests for operations under \v2\registry\validate-name + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ValidateNameRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ValidateNameRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/validate-name", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ValidateNameRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/registry/validate-name", rawUrl) + { + } + /// + /// To validate that a container registry name is available for use, send a POSTrequest to `/v2/registry/validate-name`.If the name is both formatted correctly and available, the response code willbe 204 and contain no body. If the name is already in use, the response willbe a 409 Conflict. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 409 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Validate_registry body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Validate_registry body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "409", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To validate that a container registry name is available for use, send a POSTrequest to `/v2/registry/validate-name`.If the name is both formatted correctly and available, the response code willbe 204 and contain no body. If the name is already in use, the response willbe a 409 Conflict. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Validate_registry body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Validate_registry body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.ValidateName.ValidateNameRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Registry.ValidateName.ValidateNameRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ValidateNameRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reports/Droplet_neighbors_ids/Droplet_neighbors_idsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reports/Droplet_neighbors_ids/Droplet_neighbors_idsRequestBuilder.cs new file mode 100644 index 0000000..487a6a2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reports/Droplet_neighbors_ids/Droplet_neighbors_idsRequestBuilder.cs @@ -0,0 +1,105 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reports.Droplet_neighbors_ids +{ + /// + /// Builds and executes requests for operations under \v2\reports\droplet_neighbors_ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplet_neighbors_idsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Droplet_neighbors_idsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reports/droplet_neighbors_ids", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Droplet_neighbors_idsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reports/droplet_neighbors_ids", rawUrl) + { + } + /// + /// To retrieve a list of all Droplets that are co-located on the same physicalhardware, send a GET request to `/v2/reports/droplet_neighbors_ids`.The results will be returned as a JSON object with a key of `neighbor_ids`.This will be set to an array of arrays. Each array will contain a set ofDroplet IDs for Droplets that share a physical server. An empty arrayindicates that all Droplets associated with your account are located onseparate physical hardware. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.Models.Neighbor_ids.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve a list of all Droplets that are co-located on the same physicalhardware, send a GET request to `/v2/reports/droplet_neighbors_ids`.The results will be returned as a JSON object with a key of `neighbor_ids`.This will be set to an array of arrays. Each array will contain a set ofDroplet IDs for Droplets that share a physical server. An empty arrayindicates that all Droplets associated with your account are located onseparate physical hardware. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Reports.Droplet_neighbors_ids.Droplet_neighbors_idsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Reports.Droplet_neighbors_ids.Droplet_neighbors_idsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Droplet_neighbors_idsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reports/ReportsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reports/ReportsRequestBuilder.cs new file mode 100644 index 0000000..e7af947 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reports/ReportsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Reports.Droplet_neighbors_ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reports +{ + /// + /// Builds and executes requests for operations under \v2\reports + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ReportsRequestBuilder : BaseRequestBuilder + { + /// The droplet_neighbors_ids property + public global::InfinityFlow.DigitalOcean.Client.V2.Reports.Droplet_neighbors_ids.Droplet_neighbors_idsRequestBuilder Droplet_neighbors_ids + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Reports.Droplet_neighbors_ids.Droplet_neighbors_idsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ReportsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reports", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ReportsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reports", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionObject.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionObject.cs new file mode 100644 index 0000000..c5c255c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionObject.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class ActionObject : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionObject CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionObject(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsGetResponse.cs new file mode 100644 index 0000000..9d9e9e7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ActionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.ActionObject.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsPostResponse.cs new file mode 100644 index 0000000..9cef0c2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsPostResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse_action? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse_action Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ActionsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse_action.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsPostResponse_action.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsPostResponse_action.cs new file mode 100644 index 0000000..1a78f85 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsPostResponse_action.cs @@ -0,0 +1,51 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse_action : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse_action CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse_action(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..e8ea1bf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,317 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions +{ + /// + /// Builds and executes requests for operations under \v2\reserved_ips\{reserved_ip}\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.reserved_ips.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.reserved_ips.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips/{reserved_ip}/actions", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips/{reserved_ip}/actions", rawUrl) + { + } + /// + /// To retrieve all actions that have been executed on a reserved IP, send a GET request to `/v2/reserved_ips/$RESERVED_IP/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsActionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsActionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on a reserved IP, send a GET request to `/v2/reserved_ips/$RESERVED_IP/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsActionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a reserved IP send a POST request to`/v2/reserved_ips/$RESERVED_IP/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details|------------|--------| `assign` | Assigns a reserved IP to a Droplet| `unassign` | Unassign a reserved IP from a Droplet + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a reserved IP send a POST request to`/v2/reserved_ips/$RESERVED_IP/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details|------------|--------| `assign` | Assigns a reserved IP to a Droplet| `unassign` | Unassign a reserved IP from a Droplet + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsActionsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on a reserved IP, send a GET request to `/v2/reserved_ips/$RESERVED_IP/actions`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To initiate an action on a reserved IP send a POST request to`/v2/reserved_ips/$RESERVED_IP/actions`. In the JSON body to the request,set the `type` attribute to on of the supported action types:| Action | Details|------------|--------| `assign` | Assigns a reserved IP to a Droplet| `unassign` | Unassign a reserved IP from a Droplet + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_assign? ReservedIpActionAssign { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_assign ReservedIpActionAssign { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_unassign? ReservedIpActionUnassign { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_unassign ReservedIpActionUnassign { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody(); + result.ReservedIpActionAssign = new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_assign(); + result.ReservedIpActionUnassign = new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_action_unassign(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(ReservedIpActionAssign != null || ReservedIpActionUnassign != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(ReservedIpActionAssign, ReservedIpActionUnassign); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, ReservedIpActionAssign, ReservedIpActionUnassign); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsResponse.cs new file mode 100644 index 0000000..7214a54 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions +{ + [Obsolete("This class is obsolete. Use ActionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/ActionObject.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/ActionObject.cs new file mode 100644 index 0000000..7e89aaa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/ActionObject.cs @@ -0,0 +1,50 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class ActionObject : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.ActionObject CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.ActionObject(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_GetResponse.cs new file mode 100644 index 0000000..2494a6d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_GetResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse_action? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse_action Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithAction_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse_action.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_GetResponse_action.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_GetResponse_action.cs new file mode 100644 index 0000000..0c02f36 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_GetResponse_action.cs @@ -0,0 +1,51 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_GetResponse_action : global::InfinityFlow.DigitalOcean.Client.Models.ActionObject, IParsable + #pragma warning restore CS1591 + { + /// The UUID of the project to which the reserved IP currently belongs. + public Guid? ProjectId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse_action CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse_action(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "project_id", n => { ProjectId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("project_id", ProjectId); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_ItemRequestBuilder.cs new file mode 100644 index 0000000..1b152c0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_ItemRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item +{ + /// + /// Builds and executes requests for operations under \v2\reserved_ips\{reserved_ip}\actions\{action_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips/{reserved_ip}/actions/{action_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips/{reserved_ip}/actions/{action_id}", rawUrl) + { + } + /// + /// To retrieve the status of a reserved IP action, send a GET request to `/v2/reserved_ips/$RESERVED_IP/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithAction_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithAction_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of a reserved IP action, send a GET request to `/v2/reserved_ips/$RESERVED_IP/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithAction_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of a reserved IP action, send a GET request to `/v2/reserved_ips/$RESERVED_IP/actions/$ACTION_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_Response.cs new file mode 100644 index 0000000..889c055 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/Actions/Item/WithAction_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item +{ + [Obsolete("This class is obsolete. Use WithAction_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_Response : global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.Item.WithAction_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipGetResponse.cs new file mode 100644 index 0000000..bd201c6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithReserved_ipGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The reserved_ip property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip? ReservedIp { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip ReservedIp { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithReserved_ipGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "reserved_ip", n => { ReservedIp = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("reserved_ip", ReservedIp); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipItemRequestBuilder.cs new file mode 100644 index 0000000..be22528 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipItemRequestBuilder.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item +{ + /// + /// Builds and executes requests for operations under \v2\reserved_ips\{reserved_ip} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithReserved_ipItemRequestBuilder : BaseRequestBuilder + { + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithReserved_ipItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips/{reserved_ip}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithReserved_ipItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips/{reserved_ip}", rawUrl) + { + } + /// + /// To delete a reserved IP and remove it from your account, send a DELETE requestto `/v2/reserved_ips/$RESERVED_IP_ADDR`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a reserved IP, send a GET request to `/v2/reserved_ips/$RESERVED_IP_ADDR`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithReserved_ipGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithReserved_ipGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a reserved IP, send a GET request to `/v2/reserved_ips/$RESERVED_IP_ADDR`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithReserved_ipGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a reserved IP and remove it from your account, send a DELETE requestto `/v2/reserved_ips/$RESERVED_IP_ADDR`.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about a reserved IP, send a GET request to `/v2/reserved_ips/$RESERVED_IP_ADDR`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithReserved_ipItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithReserved_ipItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipResponse.cs new file mode 100644 index 0000000..26160e6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Item/WithReserved_ipResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item +{ + [Obsolete("This class is obsolete. Use WithReserved_ipGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithReserved_ipResponse : global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsGetResponse.cs new file mode 100644 index 0000000..cdc34d2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ipsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The reserved_ips property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ReservedIps { get; set; } +#nullable restore +#else + public List ReservedIps { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Reserved_ipsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "reserved_ips", n => { ReservedIps = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("reserved_ips", ReservedIps); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsPostResponse.cs new file mode 100644 index 0000000..9f9672a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsPostResponse.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ipsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse_links Links { get; set; } +#endif + /// The reserved_ip property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip? ReservedIp { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip ReservedIp { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Reserved_ipsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse_links.CreateFromDiscriminatorValue); } }, + { "reserved_ip", n => { ReservedIp = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("reserved_ip", ReservedIp); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsPostResponse_links.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsPostResponse_links.cs new file mode 100644 index 0000000..11e822f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsPostResponse_links.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ipsPostResponse_links : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The droplets property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Droplets { get; set; } +#nullable restore +#else + public List Droplets { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Reserved_ipsPostResponse_links() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse_links CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse_links(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Action_link.CreateFromDiscriminatorValue)?.AsList(); } }, + { "droplets", n => { Droplets = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Action_link.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteCollectionOfObjectValues("droplets", Droplets); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsRequestBuilder.cs new file mode 100644 index 0000000..3abf632 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsRequestBuilder.cs @@ -0,0 +1,296 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips +{ + /// + /// Builds and executes requests for operations under \v2\reserved_ips + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reserved_ipsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.reserved_ips.item collection + /// A reserved IP address. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("reserved_ip", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Item.WithReserved_ipItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Reserved_ipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Reserved_ipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/reserved_ips{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the reserved IPs available on your account, send a GET request to `/v2/reserved_ips`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsReserved_ipsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsReserved_ipsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the reserved IPs available on your account, send a GET request to `/v2/reserved_ips`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsReserved_ipsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// On creation, a reserved IP must be either assigned to a Droplet or reserved to a region.* To create a new reserved IP assigned to a Droplet, send a POST request to `/v2/reserved_ips` with the `droplet_id` attribute.* To create a new reserved IP reserved to a region, send a POST request to `/v2/reserved_ips` with the `region` attribute.**Note**: In addition to the standard rate limiting, only 12 reserved IPs may be created per 60 seconds. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsReserved_ipsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_create body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsReserved_ipsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_create body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + + /// + /// To list all of the reserved IPs available on your account, send a GET request to `/v2/reserved_ips`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// On creation, a reserved IP must be either assigned to a Droplet or reserved to a region.* To create a new reserved IP assigned to a Droplet, send a POST request to `/v2/reserved_ips` with the `droplet_id` attribute.* To create a new reserved IP reserved to a region, send a POST request to `/v2/reserved_ips` with the `region` attribute.**Note**: In addition to the standard rate limiting, only 12 reserved IPs may be created per 60 seconds. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_create body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_create body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the reserved IPs available on your account, send a GET request to `/v2/reserved_ips`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reserved_ipsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reserved_ipsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reserved_ipsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Reserved_ip_create : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1? ReservedIpCreateMember1 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1 ReservedIpCreateMember1 { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2? ReservedIpCreateMember2 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2 ReservedIpCreateMember2 { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsRequestBuilder.Reserved_ip_create CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsRequestBuilder.Reserved_ip_create(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.ReservedIpCreateMember1 = new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember1(); + } + else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) + { + result.ReservedIpCreateMember2 = new global::InfinityFlow.DigitalOcean.Client.Models.Reserved_ip_createMember2(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(ReservedIpCreateMember1 != null) + { + return ReservedIpCreateMember1.GetFieldDeserializers(); + } + else if(ReservedIpCreateMember2 != null) + { + return ReservedIpCreateMember2.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(ReservedIpCreateMember1 != null) + { + writer.WriteObjectValue(null, ReservedIpCreateMember1); + } + else if(ReservedIpCreateMember2 != null) + { + writer.WriteObjectValue(null, ReservedIpCreateMember2); + } + } + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsResponse.cs new file mode 100644 index 0000000..f0e6fcc --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Reserved_ips/Reserved_ipsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Reserved_ips +{ + [Obsolete("This class is obsolete. Use Reserved_ipsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Reserved_ipsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesGetResponse.cs new file mode 100644 index 0000000..d8f13e7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Sizes +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SizesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The sizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Sizes { get; set; } +#nullable restore +#else + public List Sizes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SizesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "sizes", n => { Sizes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Size.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("sizes", Sizes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesRequestBuilder.cs new file mode 100644 index 0000000..eac9c7c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesRequestBuilder.cs @@ -0,0 +1,146 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Sizes +{ + /// + /// Builds and executes requests for operations under \v2\sizes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SizesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SizesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/sizes{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SizesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/sizes{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of available Droplet sizes, send a GET request to `/v2/sizes`.The response will be a JSON object with a key called `sizes`. The value of this will be an array of `size` objects each of which contain the standard size attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsSizesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsSizesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of available Droplet sizes, send a GET request to `/v2/sizes`.The response will be a JSON object with a key called `sizes`. The value of this will be an array of `size` objects each of which contain the standard size attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsSizesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of available Droplet sizes, send a GET request to `/v2/sizes`.The response will be a JSON object with a key called `sizes`. The value of this will be an array of `size` objects each of which contain the standard size attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of available Droplet sizes, send a GET request to `/v2/sizes`.The response will be a JSON object with a key called `sizes`. The value of this will be an array of `size` objects each of which contain the standard size attributes. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SizesRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SizesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesResponse.cs new file mode 100644 index 0000000..455dbb9 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Sizes/SizesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Sizes +{ + [Obsolete("This class is obsolete. Use SizesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SizesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/GetResource_typeQueryParameterType.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/GetResource_typeQueryParameterType.cs new file mode 100644 index 0000000..775e373 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/GetResource_typeQueryParameterType.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Snapshots +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public enum GetResource_typeQueryParameterType + #pragma warning restore CS1591 + { + [EnumMember(Value = "droplet")] + #pragma warning disable CS1591 + Droplet, + #pragma warning restore CS1591 + [EnumMember(Value = "volume")] + #pragma warning disable CS1591 + Volume, + #pragma warning restore CS1591 + } +} diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_GetResponse.cs new file mode 100644 index 0000000..c205974 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSnapshot_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The snapshot property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Snapshots? Snapshot { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Snapshots Snapshot { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithSnapshot_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "snapshot", n => { Snapshot = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Snapshots.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("snapshot", Snapshot); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_ItemRequestBuilder.cs new file mode 100644 index 0000000..f9f1b53 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_ItemRequestBuilder.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item +{ + /// + /// Builds and executes requests for operations under \v2\snapshots\{snapshot_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSnapshot_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSnapshot_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/snapshots/{snapshot_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSnapshot_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/snapshots/{snapshot_id}", rawUrl) + { + } + /// + /// Both Droplet and volume snapshots are managed through the `/v2/snapshots/`endpoint. To delete a snapshot, send a DELETE request to`/v2/snapshots/$SNAPSHOT_ID`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve information about a snapshot, send a GET request to`/v2/snapshots/$SNAPSHOT_ID`.The response will be a JSON object with a key called `snapshot`. The value ofthis will be an snapshot object containing the standard snapshot attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithSnapshot_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithSnapshot_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve information about a snapshot, send a GET request to`/v2/snapshots/$SNAPSHOT_ID`.The response will be a JSON object with a key called `snapshot`. The value ofthis will be an snapshot object containing the standard snapshot attributes. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithSnapshot_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Both Droplet and volume snapshots are managed through the `/v2/snapshots/`endpoint. To delete a snapshot, send a DELETE request to`/v2/snapshots/$SNAPSHOT_ID`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To retrieve information about a snapshot, send a GET request to`/v2/snapshots/$SNAPSHOT_ID`.The response will be a JSON object with a key called `snapshot`. The value ofthis will be an snapshot object containing the standard snapshot attributes. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSnapshot_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSnapshot_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_Response.cs new file mode 100644 index 0000000..521c51d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/Item/WithSnapshot_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item +{ + [Obsolete("This class is obsolete. Use WithSnapshot_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSnapshot_Response : global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsGetResponse.cs new file mode 100644 index 0000000..075729d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Snapshots +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The snapshots property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Snapshots { get; set; } +#nullable restore +#else + public List Snapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SnapshotsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "snapshots", n => { Snapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Snapshots.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("snapshots", Snapshots); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsRequestBuilder.cs new file mode 100644 index 0000000..b17e8b7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsRequestBuilder.cs @@ -0,0 +1,186 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Snapshots +{ + /// + /// Builds and executes requests for operations under \v2\snapshots + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.snapshots.item collection + /// Either the ID of an existing snapshot. This will be an integer for a Droplet snapshot or a string for a volume snapshot. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("snapshot_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.snapshots.item collection + /// Either the ID of an existing snapshot. This will be an integer for a Droplet snapshot or a string for a volume snapshot. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("snapshot_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.Item.WithSnapshot_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/snapshots{?page*,per_page*,resource_type*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/snapshots{?page*,per_page*,resource_type*}", rawUrl) + { + } + /// + /// To list all of the snapshots available on your account, send a GET request to`/v2/snapshots`.The response will be a JSON object with a key called `snapshots`. This will beset to an array of `snapshot` objects, each of which will contain the standardsnapshot attributes.### Filtering Results by Resource TypeIt's possible to request filtered results by including certain query parameters.#### List Droplet SnapshotsTo retrieve only snapshots based on Droplets, include the `resource_type`query parameter set to `droplet`. For example, `/v2/snapshots?resource_type=droplet`.#### List Volume SnapshotsTo retrieve only snapshots based on volumes, include the `resource_type`query parameter set to `volume`. For example, `/v2/snapshots?resource_type=volume`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsSnapshotsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsSnapshotsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the snapshots available on your account, send a GET request to`/v2/snapshots`.The response will be a JSON object with a key called `snapshots`. This will beset to an array of `snapshot` objects, each of which will contain the standardsnapshot attributes.### Filtering Results by Resource TypeIt's possible to request filtered results by including certain query parameters.#### List Droplet SnapshotsTo retrieve only snapshots based on Droplets, include the `resource_type`query parameter set to `droplet`. For example, `/v2/snapshots?resource_type=droplet`.#### List Volume SnapshotsTo retrieve only snapshots based on volumes, include the `resource_type`query parameter set to `volume`. For example, `/v2/snapshots?resource_type=volume`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsSnapshotsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the snapshots available on your account, send a GET request to`/v2/snapshots`.The response will be a JSON object with a key called `snapshots`. This will beset to an array of `snapshot` objects, each of which will contain the standardsnapshot attributes.### Filtering Results by Resource TypeIt's possible to request filtered results by including certain query parameters.#### List Droplet SnapshotsTo retrieve only snapshots based on Droplets, include the `resource_type`query parameter set to `droplet`. For example, `/v2/snapshots?resource_type=droplet`.#### List Volume SnapshotsTo retrieve only snapshots based on volumes, include the `resource_type`query parameter set to `volume`. For example, `/v2/snapshots?resource_type=volume`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the snapshots available on your account, send a GET request to`/v2/snapshots`.The response will be a JSON object with a key called `snapshots`. This will beset to an array of `snapshot` objects, each of which will contain the standardsnapshot attributes.### Filtering Results by Resource TypeIt's possible to request filtered results by including certain query parameters.#### List Droplet SnapshotsTo retrieve only snapshots based on Droplets, include the `resource_type`query parameter set to `droplet`. For example, `/v2/snapshots?resource_type=droplet`.#### List Volume SnapshotsTo retrieve only snapshots based on volumes, include the `resource_type`query parameter set to `volume`. For example, `/v2/snapshots?resource_type=volume`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// Used to filter snapshots by a resource type. + [Obsolete("This property is deprecated, use ResourceTypeAsGetResourceTypeQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("resource_type")] + public string? ResourceType { get; set; } +#nullable restore +#else + [QueryParameter("resource_type")] + public string ResourceType { get; set; } +#endif + /// Used to filter snapshots by a resource type. + [QueryParameter("resource_type")] + public global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.GetResource_typeQueryParameterType? ResourceTypeAsGetResourceTypeQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsResponse.cs new file mode 100644 index 0000000..534df0a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Snapshots/SnapshotsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Snapshots +{ + [Obsolete("This class is obsolete. Use SnapshotsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/Resources/ResourcesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/Resources/ResourcesRequestBuilder.cs new file mode 100644 index 0000000..87d3f8a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/Resources/ResourcesRequestBuilder.cs @@ -0,0 +1,171 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags.Item.Resources +{ + /// + /// Builds and executes requests for operations under \v2\tags\{tag_id}\resources + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ResourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/tags/{tag_id}/resources", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ResourcesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/tags/{tag_id}/resources", rawUrl) + { + } + /// + /// Resources can be untagged by sending a DELETE request to `/v2/tags/$TAG_NAME/resources` with an array of json objects containing `resource_id` and `resource_type` attributes.Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported. `resource_type` is expected to be the string `droplet`, `database`, `image`, `volume` or `volume_snapshot`. `resource_id` is expected to be the ID of the resource as a string. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Resources can be tagged by sending a POST request to `/v2/tags/$TAG_NAME/resources` with an array of json objects containing `resource_id` and `resource_type` attributes.Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported. `resource_type` is expected to be the string `droplet`, `database`, `image`, `volume` or `volume_snapshot`. `resource_id` is expected to be the ID of the resource as a string. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Resources can be untagged by sending a DELETE request to `/v2/tags/$TAG_NAME/resources` with an array of json objects containing `resource_id` and `resource_type` attributes.Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported. `resource_type` is expected to be the string `droplet`, `database`, `image`, `volume` or `volume_snapshot`. `resource_id` is expected to be the ID of the resource as a string. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Resources can be tagged by sending a POST request to `/v2/tags/$TAG_NAME/resources` with an array of json objects containing `resource_id` and `resource_type` attributes.Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported. `resource_type` is expected to be the string `droplet`, `database`, `image`, `volume` or `volume_snapshot`. `resource_id` is expected to be the ID of the resource as a string. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Tags_resource body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.Resources.ResourcesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.Resources.ResourcesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ResourcesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_GetResponse.cs new file mode 100644 index 0000000..0492897 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTag_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it.Tags have two attributes: a user defined `name` attribute and an embedded `resources` attribute with information about resources that have been tagged. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags? Tag { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags Tag { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithTag_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "tag", n => { Tag = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("tag", Tag); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_ItemRequestBuilder.cs new file mode 100644 index 0000000..fec4ef6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_ItemRequestBuilder.cs @@ -0,0 +1,200 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Tags.Item.Resources; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags.Item +{ + /// + /// Builds and executes requests for operations under \v2\tags\{tag_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTag_ItemRequestBuilder : BaseRequestBuilder + { + /// The resources property + public global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.Resources.ResourcesRequestBuilder Resources + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.Resources.ResourcesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTag_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/tags/{tag_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTag_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/tags/{tag_id}", rawUrl) + { + } + /// + /// A tag can be deleted by sending a `DELETE` request to `/v2/tags/$TAG_NAME`. Deleting a tag also untags all the resources that have previously been tagged by the Tag + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve an individual tag, you can send a `GET` request to `/v2/tags/$TAG_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithTag_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithTag_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve an individual tag, you can send a `GET` request to `/v2/tags/$TAG_NAME`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithTag_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// A tag can be deleted by sending a `DELETE` request to `/v2/tags/$TAG_NAME`. Deleting a tag also untags all the resources that have previously been tagged by the Tag + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To retrieve an individual tag, you can send a `GET` request to `/v2/tags/$TAG_NAME`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTag_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithTag_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_Response.cs new file mode 100644 index 0000000..588b293 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/Item/WithTag_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags.Item +{ + [Obsolete("This class is obsolete. Use WithTag_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithTag_Response : global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsGetResponse.cs new file mode 100644 index 0000000..34c4371 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TagsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TagsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "tags", n => { Tags = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Tags.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsPostResponse.cs new file mode 100644 index 0000000..a875298 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TagsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it.Tags have two attributes: a user defined `name` attribute and an embedded `resources` attribute with information about resources that have been tagged. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Tags? Tag { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Tags Tag { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TagsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "tag", n => { Tag = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Tags.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("tag", Tag); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsRequestBuilder.cs new file mode 100644 index 0000000..47aa9aa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsRequestBuilder.cs @@ -0,0 +1,256 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Tags.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags +{ + /// + /// Builds and executes requests for operations under \v2\tags + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.tags.item collection + /// The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("tag_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.Item.WithTag_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TagsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/tags{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/tags{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of your tags, you can send a GET request to `/v2/tags`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsTagsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsTagsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of your tags, you can send a GET request to `/v2/tags`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsTagsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a tag you can send a POST request to `/v2/tags` with a `name` attribute. + /// + /// A + /// A tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it.Tags have two attributes: a user defined `name` attribute and an embedded `resources` attribute with information about resources that have been tagged. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsTagsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsTagsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error_with_root_causes.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a tag you can send a POST request to `/v2/tags` with a `name` attribute. + /// + /// A + /// A tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it.Tags have two attributes: a user defined `name` attribute and an embedded `resources` attribute with information about resources that have been tagged. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsTagsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.Models.Tags body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error_with_root_causes.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of your tags, you can send a GET request to `/v2/tags`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a tag you can send a POST request to `/v2/tags` with a `name` attribute. + /// + /// A + /// A tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it.Tags have two attributes: a user defined `name` attribute and an embedded `resources` attribute with information about resources that have been tagged. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Tags body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.Models.Tags body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of your tags, you can send a GET request to `/v2/tags`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TagsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsResponse.cs new file mode 100644 index 0000000..330100b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Tags/TagsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Tags +{ + [Obsolete("This class is obsolete. Use TagsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class TagsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksGetResponse.cs new file mode 100644 index 0000000..2d63def --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ChecksGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The checks property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Checks { get; set; } +#nullable restore +#else + public List Checks { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ChecksGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "checks", n => { Checks = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Check.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("checks", Checks); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksPostRequestBody.cs new file mode 100644 index 0000000..c80ef74 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksPostRequestBody.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ChecksPostRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Check_updatable, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksPostResponse.cs new file mode 100644 index 0000000..125a9cb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ChecksPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The check property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Check? Check { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Check Check { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ChecksPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "check", n => { Check = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Check.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("check", Check); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksRequestBuilder.cs new file mode 100644 index 0000000..c6c70da --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksRequestBuilder.cs @@ -0,0 +1,269 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks +{ + /// + /// Builds and executes requests for operations under \v2\uptime\checks + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ChecksRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.uptime.checks.item collection + /// A unique identifier for a check. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("check_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.uptime.checks.item collection + /// A unique identifier for a check. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("check_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChecksRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChecksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the Uptime checks on your account, send a GET request to `/v2/uptime/checks`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsChecksGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsChecksGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the Uptime checks on your account, send a GET request to `/v2/uptime/checks`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsChecksGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create an Uptime check, send a POST request to `/v2/uptime/checks` specifying the attributesin the table below in the JSON body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsChecksPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsChecksPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create an Uptime check, send a POST request to `/v2/uptime/checks` specifying the attributesin the table below in the JSON body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsChecksPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the Uptime checks on your account, send a GET request to `/v2/uptime/checks`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create an Uptime check, send a POST request to `/v2/uptime/checks` specifying the attributesin the table below in the JSON body. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the Uptime checks on your account, send a GET request to `/v2/uptime/checks`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ChecksRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ChecksRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ChecksRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksResponse.cs new file mode 100644 index 0000000..2b7056c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/ChecksResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks +{ + [Obsolete("This class is obsolete. Use ChecksGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ChecksResponse : global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsGetResponse.cs new file mode 100644 index 0000000..194b81f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AlertsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alerts property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Alerts { get; set; } +#nullable restore +#else + public List Alerts { get; set; } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AlertsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alerts", n => { Alerts = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Alert.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("alerts", Alerts); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsPostRequestBody.cs new file mode 100644 index 0000000..b02fc3d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsPostRequestBody.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AlertsPostRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Alert, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsPostResponse.cs new file mode 100644 index 0000000..36f081e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AlertsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alert property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alert? Alert { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alert Alert { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AlertsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alert", n => { Alert = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alert.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alert", Alert); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsRequestBuilder.cs new file mode 100644 index 0000000..77091be --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsRequestBuilder.cs @@ -0,0 +1,273 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts +{ + /// + /// Builds and executes requests for operations under \v2\uptime\checks\{check_id}\alerts + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.uptime.checks.item.alerts.item collection + /// A unique identifier for an alert. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("alert_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.uptime.checks.item.alerts.item collection + /// A unique identifier for an alert. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("alert_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AlertsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}/alerts{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AlertsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}/alerts{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the alerts for an Uptime check, send a GET request to `/v2/uptime/checks/$CHECK_ID/alerts`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsAlertsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsAlertsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the alerts for an Uptime check, send a GET request to `/v2/uptime/checks/$CHECK_ID/alerts`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsAlertsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create an Uptime alert, send a POST request to `/v2/uptime/checks/$CHECK_ID/alerts` specifying the attributesin the table below in the JSON body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsAlertsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsAlertsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create an Uptime alert, send a POST request to `/v2/uptime/checks/$CHECK_ID/alerts` specifying the attributesin the table below in the JSON body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsAlertsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the alerts for an Uptime check, send a GET request to `/v2/uptime/checks/$CHECK_ID/alerts`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create an Uptime alert, send a POST request to `/v2/uptime/checks/$CHECK_ID/alerts` specifying the attributesin the table below in the JSON body. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the alerts for an Uptime check, send a GET request to `/v2/uptime/checks/$CHECK_ID/alerts`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class AlertsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsResponse.cs new file mode 100644 index 0000000..7dc35f8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/AlertsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts +{ + [Obsolete("This class is obsolete. Use AlertsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class AlertsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_GetResponse.cs new file mode 100644 index 0000000..0a7972e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAlert_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alert property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alert? Alert { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alert Alert { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithAlert_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alert", n => { Alert = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alert.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alert", Alert); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_ItemRequestBuilder.cs new file mode 100644 index 0000000..3f4cbc2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_ItemRequestBuilder.cs @@ -0,0 +1,291 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item +{ + /// + /// Builds and executes requests for operations under \v2\uptime\checks\{check_id}\alerts\{alert_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAlert_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}/alerts/{alert_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAlert_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}/alerts/{alert_id}", rawUrl) + { + } + /// + /// To delete an Uptime alert, send a DELETE request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. A 204 statuscode with no body will be returned in response to a successful request. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing alert, send a GET request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithAlert_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithAlert_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing alert, send a GET request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithAlert_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the settings of an Uptime alert, send a PUT request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithAlert_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithAlert_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the settings of an Uptime alert, send a PUT request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithAlert_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete an Uptime alert, send a DELETE request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. A 204 statuscode with no body will be returned in response to a successful request. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing alert, send a GET request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the settings of an Uptime alert, send a PUT request to `/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAlert_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_PutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_PutRequestBody.cs new file mode 100644 index 0000000..256bf83 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_PutRequestBody.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAlert_PutRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Alert_updatable, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_PutResponse.cs new file mode 100644 index 0000000..925500c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAlert_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alert property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Alert? Alert { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Alert Alert { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithAlert_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alert", n => { Alert = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Alert.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alert", Alert); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_Response.cs new file mode 100644 index 0000000..ca3d70e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/Alerts/Item/WithAlert_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item +{ + [Obsolete("This class is obsolete. Use WithAlert_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAlert_Response : global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.Item.WithAlert_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateGetResponse.cs new file mode 100644 index 0000000..df9613f --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateGetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class StateGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The state property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.State? State { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.State State { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StateGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "state", n => { State = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.State.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("state", State); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateRequestBuilder.cs new file mode 100644 index 0000000..4423116 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateRequestBuilder.cs @@ -0,0 +1,137 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State +{ + /// + /// Builds and executes requests for operations under \v2\uptime\checks\{check_id}\state + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class StateRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}/state", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}/state", rawUrl) + { + } + /// + /// To show information about an existing check's state, send a GET request to `/v2/uptime/checks/$CHECK_ID/state`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsStateGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsStateGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing check's state, send a GET request to `/v2/uptime/checks/$CHECK_ID/state`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsStateGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing check's state, send a GET request to `/v2/uptime/checks/$CHECK_ID/state`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class StateRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateResponse.cs new file mode 100644 index 0000000..31ea2d4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/State/StateResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State +{ + [Obsolete("This class is obsolete. Use StateGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class StateResponse : global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_GetResponse.cs new file mode 100644 index 0000000..9e47a84 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCheck_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The check property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Check? Check { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Check Check { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithCheck_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "check", n => { Check = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Check.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("check", Check); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_ItemRequestBuilder.cs new file mode 100644 index 0000000..af58003 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_ItemRequestBuilder.cs @@ -0,0 +1,303 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts; +using InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item +{ + /// + /// Builds and executes requests for operations under \v2\uptime\checks\{check_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCheck_ItemRequestBuilder : BaseRequestBuilder + { + /// The alerts property + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsRequestBuilder Alerts + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.Alerts.AlertsRequestBuilder(PathParameters, RequestAdapter); + } + /// The state property + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateRequestBuilder State + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.State.StateRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCheck_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCheck_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime/checks/{check_id}", rawUrl) + { + } + /// + /// To delete an Uptime check, send a DELETE request to `/v2/uptime/checks/$CHECK_ID`. A 204 statuscode with no body will be returned in response to a successful request.Deleting a check will also delete alerts associated with the check. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing check, send a GET request to `/v2/uptime/checks/$CHECK_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithCheck_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithCheck_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing check, send a GET request to `/v2/uptime/checks/$CHECK_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithCheck_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the settings of an Uptime check, send a PUT request to `/v2/uptime/checks/$CHECK_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithCheck_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithCheck_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the settings of an Uptime check, send a PUT request to `/v2/uptime/checks/$CHECK_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithCheck_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete an Uptime check, send a DELETE request to `/v2/uptime/checks/$CHECK_ID`. A 204 statuscode with no body will be returned in response to a successful request.Deleting a check will also delete alerts associated with the check. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing check, send a GET request to `/v2/uptime/checks/$CHECK_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the settings of an Uptime check, send a PUT request to `/v2/uptime/checks/$CHECK_ID`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCheck_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCheck_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithCheck_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_PutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_PutRequestBody.cs new file mode 100644 index 0000000..b6d8c2b --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_PutRequestBody.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCheck_PutRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Check_updatable, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_PutResponse.cs new file mode 100644 index 0000000..9dbf6a7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCheck_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The check property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Check? Check { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Check Check { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithCheck_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "check", n => { Check = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Check.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("check", Check); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_Response.cs new file mode 100644 index 0000000..dded3bb --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/Checks/Item/WithCheck_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item +{ + [Obsolete("This class is obsolete. Use WithCheck_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithCheck_Response : global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.Item.WithCheck_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/UptimeRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/UptimeRequestBuilder.cs new file mode 100644 index 0000000..3890074 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Uptime/UptimeRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Uptime +{ + /// + /// Builds and executes requests for operations under \v2\uptime + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class UptimeRequestBuilder : BaseRequestBuilder + { + /// The checks property + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksRequestBuilder Checks + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.Checks.ChecksRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UptimeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UptimeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/uptime", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/V2RequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/V2RequestBuilder.cs new file mode 100644 index 0000000..f50ad9c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/V2RequestBuilder.cs @@ -0,0 +1,209 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Account; +using InfinityFlow.DigitalOcean.Client.V2.Actions; +using InfinityFlow.DigitalOcean.Client.V2.Apps; +using InfinityFlow.DigitalOcean.Client.V2.Cdn; +using InfinityFlow.DigitalOcean.Client.V2.Certificates; +using InfinityFlow.DigitalOcean.Client.V2.Customers; +using InfinityFlow.DigitalOcean.Client.V2.Databases; +using InfinityFlow.DigitalOcean.Client.V2.Domains; +using InfinityFlow.DigitalOcean.Client.V2.Droplets; +using InfinityFlow.DigitalOcean.Client.V2.Firewalls; +using InfinityFlow.DigitalOcean.Client.V2.Floating_ips; +using InfinityFlow.DigitalOcean.Client.V2.Functions; +using InfinityFlow.DigitalOcean.Client.V2.Images; +using InfinityFlow.DigitalOcean.Client.V2.Kubernetes; +using InfinityFlow.DigitalOcean.Client.V2.Load_balancers; +using InfinityFlow.DigitalOcean.Client.V2.Monitoring; +using InfinityFlow.DigitalOcean.Client.V2.OneClicks; +using InfinityFlow.DigitalOcean.Client.V2.Projects; +using InfinityFlow.DigitalOcean.Client.V2.Regions; +using InfinityFlow.DigitalOcean.Client.V2.Registry; +using InfinityFlow.DigitalOcean.Client.V2.Reports; +using InfinityFlow.DigitalOcean.Client.V2.Reserved_ips; +using InfinityFlow.DigitalOcean.Client.V2.Sizes; +using InfinityFlow.DigitalOcean.Client.V2.Snapshots; +using InfinityFlow.DigitalOcean.Client.V2.Tags; +using InfinityFlow.DigitalOcean.Client.V2.Uptime; +using InfinityFlow.DigitalOcean.Client.V2.Volumes; +using InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings; +using InfinityFlow.DigitalOcean.Client.V2.Vpcs; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2 +{ + /// + /// Builds and executes requests for operations under \v2 + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class V2RequestBuilder : BaseRequestBuilder + { + /// The account property + public global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountRequestBuilder Account + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Account.AccountRequestBuilder(PathParameters, RequestAdapter); + } + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The apps property + public global::InfinityFlow.DigitalOcean.Client.V2.Apps.AppsRequestBuilder Apps + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Apps.AppsRequestBuilder(PathParameters, RequestAdapter); + } + /// The cdn property + public global::InfinityFlow.DigitalOcean.Client.V2.Cdn.CdnRequestBuilder Cdn + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Cdn.CdnRequestBuilder(PathParameters, RequestAdapter); + } + /// The certificates property + public global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder Certificates + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Certificates.CertificatesRequestBuilder(PathParameters, RequestAdapter); + } + /// The customers property + public global::InfinityFlow.DigitalOcean.Client.V2.Customers.CustomersRequestBuilder Customers + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Customers.CustomersRequestBuilder(PathParameters, RequestAdapter); + } + /// The databases property + public global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesRequestBuilder Databases + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Databases.DatabasesRequestBuilder(PathParameters, RequestAdapter); + } + /// The domains property + public global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsRequestBuilder Domains + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Domains.DomainsRequestBuilder(PathParameters, RequestAdapter); + } + /// The droplets property + public global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder Droplets + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Droplets.DropletsRequestBuilder(PathParameters, RequestAdapter); + } + /// The firewalls property + public global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsRequestBuilder Firewalls + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Firewalls.FirewallsRequestBuilder(PathParameters, RequestAdapter); + } + /// The floating_ips property + public global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsRequestBuilder Floating_ips + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Floating_ips.Floating_ipsRequestBuilder(PathParameters, RequestAdapter); + } + /// The functions property + public global::InfinityFlow.DigitalOcean.Client.V2.Functions.FunctionsRequestBuilder Functions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Functions.FunctionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The images property + public global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesRequestBuilder Images + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Images.ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The kubernetes property + public global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.KubernetesRequestBuilder Kubernetes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Kubernetes.KubernetesRequestBuilder(PathParameters, RequestAdapter); + } + /// The load_balancers property + public global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersRequestBuilder Load_balancers + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Load_balancers.Load_balancersRequestBuilder(PathParameters, RequestAdapter); + } + /// The monitoring property + public global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.MonitoringRequestBuilder Monitoring + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Monitoring.MonitoringRequestBuilder(PathParameters, RequestAdapter); + } + /// The OneClicks property + public global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksRequestBuilder OneClicks + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.OneClicks.OneClicksRequestBuilder(PathParameters, RequestAdapter); + } + /// The projects property + public global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsRequestBuilder Projects + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Projects.ProjectsRequestBuilder(PathParameters, RequestAdapter); + } + /// The regions property + public global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsRequestBuilder Regions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Regions.RegionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The registry property + public global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryRequestBuilder Registry + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Registry.RegistryRequestBuilder(PathParameters, RequestAdapter); + } + /// The reports property + public global::InfinityFlow.DigitalOcean.Client.V2.Reports.ReportsRequestBuilder Reports + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Reports.ReportsRequestBuilder(PathParameters, RequestAdapter); + } + /// The reserved_ips property + public global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsRequestBuilder Reserved_ips + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Reserved_ips.Reserved_ipsRequestBuilder(PathParameters, RequestAdapter); + } + /// The sizes property + public global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesRequestBuilder Sizes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Sizes.SizesRequestBuilder(PathParameters, RequestAdapter); + } + /// The snapshots property + public global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsRequestBuilder Snapshots + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Snapshots.SnapshotsRequestBuilder(PathParameters, RequestAdapter); + } + /// The tags property + public global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsRequestBuilder Tags + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Tags.TagsRequestBuilder(PathParameters, RequestAdapter); + } + /// The uptime property + public global::InfinityFlow.DigitalOcean.Client.V2.Uptime.UptimeRequestBuilder Uptime + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Uptime.UptimeRequestBuilder(PathParameters, RequestAdapter); + } + /// The volumes property + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder Volumes + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder(PathParameters, RequestAdapter); + } + /// The vpcs property + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsRequestBuilder Vpcs + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsRequestBuilder(PathParameters, RequestAdapter); + } + /// The vpc_peerings property + public global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsRequestBuilder Vpc_peerings + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public V2RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public V2RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsPostResponse.cs new file mode 100644 index 0000000..b6c6362 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ActionsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..981a036 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,214 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions +{ + /// + /// Builds and executes requests for operations under \v2\volumes\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/actions{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/actions{?page*,per_page*}", rawUrl) + { + } + /// + /// To initiate an action on a block storage volume by Name, send a POST request to`~/v2/volumes/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `attach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `detach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located | + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a block storage volume by Name, send a POST request to`~/v2/volumes/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `attach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `detach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located | + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsActionsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a block storage volume by Name, send a POST request to`~/v2/volumes/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `attach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `detach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located | + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach? VolumeActionPostAttach { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach VolumeActionPostAttach { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach? VolumeActionPostDetach { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach VolumeActionPostDetach { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder.ActionsPostRequestBody(); + result.VolumeActionPostAttach = new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach(); + result.VolumeActionPostDetach = new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(VolumeActionPostAttach != null || VolumeActionPostDetach != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(VolumeActionPostAttach, VolumeActionPostDetach); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, VolumeActionPostAttach, VolumeActionPostDetach); + } + } + /// + /// To initiate an action on a block storage volume by Name, send a POST request to`~/v2/volumes/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `attach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ----------- | ------------------------------------------------------------------- || type | This must be `detach` || volume_name | The name of the block storage volume || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located | + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsResponse.cs new file mode 100644 index 0000000..164d390 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions +{ + [Obsolete("This class is obsolete. Use ActionsPostResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsPostResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsGetResponse.cs new file mode 100644 index 0000000..0ee9ae2 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The actions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Actions { get; set; } +#nullable restore +#else + public List Actions { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ActionsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "actions", n => { Actions = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction.CreateFromDiscriminatorValue)?.AsList(); } }, + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("actions", Actions); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsPostResponse.cs new file mode 100644 index 0000000..41df989 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ActionsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsRequestBuilder.cs new file mode 100644 index 0000000..e2e5506 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsRequestBuilder.cs @@ -0,0 +1,352 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions +{ + /// + /// Builds and executes requests for operations under \v2\volumes\{volume_id}\actions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.volumes.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.volumes.item.actions.item collection + /// A unique numeric ID that can be used to identify and reference an action. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("action_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}/actions{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}/actions{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve all actions that have been executed on a volume, send a GET request to `/v2/volumes/$VOLUME_ID/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsActionsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsActionsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on a volume, send a GET request to `/v2/volumes/$VOLUME_ID/actions`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsActionsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a block storage volume by Id, send a POST request to`~/v2/volumes/$VOLUME_ID/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `attach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `detach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |## Resize a Volume| Attribute | Details || -------------- | ------------------------------------------------------------------- || type | This must be `resize` || size_gigabytes | The new size of the block storage volume in GiB (1024^3) || region | Set to the slug representing the region where the volume is located |Volumes may only be resized upwards. The maximum size for a volume is 16TiB. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsActionsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To initiate an action on a block storage volume by Id, send a POST request to`~/v2/volumes/$VOLUME_ID/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `attach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `detach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |## Resize a Volume| Attribute | Details || -------------- | ------------------------------------------------------------------- || type | This must be `resize` || size_gigabytes | The new size of the block storage volume in GiB (1024^3) || region | Set to the slug representing the region where the volume is located |Volumes may only be resized upwards. The maximum size for a volume is 16TiB. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsActionsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve all actions that have been executed on a volume, send a GET request to `/v2/volumes/$VOLUME_ID/actions`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To initiate an action on a block storage volume by Id, send a POST request to`~/v2/volumes/$VOLUME_ID/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `attach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `detach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |## Resize a Volume| Attribute | Details || -------------- | ------------------------------------------------------------------- || type | This must be `resize` || size_gigabytes | The new size of the block storage volume in GiB (1024^3) || region | Set to the slug representing the region where the volume is located |Volumes may only be resized upwards. The maximum size for a volume is 16TiB. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach? VolumeActionPostAttach { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach VolumeActionPostAttach { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach? VolumeActionPostDetach { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach VolumeActionPostDetach { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_resize? VolumeActionPostResize { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_resize VolumeActionPostResize { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder.ActionsPostRequestBody(); + result.VolumeActionPostAttach = new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_attach(); + result.VolumeActionPostDetach = new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_detach(); + result.VolumeActionPostResize = new global::InfinityFlow.DigitalOcean.Client.Models.Volume_action_post_resize(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(VolumeActionPostAttach != null || VolumeActionPostDetach != null || VolumeActionPostResize != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(VolumeActionPostAttach, VolumeActionPostDetach, VolumeActionPostResize); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, VolumeActionPostAttach, VolumeActionPostDetach, VolumeActionPostResize); + } + } + /// + /// To retrieve all actions that have been executed on a volume, send a GET request to `/v2/volumes/$VOLUME_ID/actions`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// To initiate an action on a block storage volume by Id, send a POST request to`~/v2/volumes/$VOLUME_ID/actions`. The body should contain the appropriateattributes for the respective action.## Attach a Block Storage Volume to a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `attach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |Each volume may only be attached to a single Droplet. However, up to fifteenvolumes may be attached to a Droplet at a time. Pre-formatted volumes will beautomatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOSDroplets created on or after April 26, 2018 when attached. On older Droplets,[additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/)is required.## Remove a Block Storage Volume from a Droplet| Attribute | Details || ---------- | ------------------------------------------------------------------- || type | This must be `detach` || droplet_id | Set to the Droplet's ID || region | Set to the slug representing the region where the volume is located |## Resize a Volume| Attribute | Details || -------------- | ------------------------------------------------------------------- || type | This must be `resize` || size_gigabytes | The new size of the block storage volume in GiB (1024^3) || region | Set to the slug representing the region where the volume is located |Volumes may only be resized upwards. The maximum size for a volume is 16TiB. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ActionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsResponse.cs new file mode 100644 index 0000000..4674207 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/ActionsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions +{ + [Obsolete("This class is obsolete. Use ActionsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class ActionsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_GetResponse.cs new file mode 100644 index 0000000..eb64488 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The action property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction? Action { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction Action { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithAction_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "action", n => { Action = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.VolumeAction.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("action", Action); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_ItemRequestBuilder.cs new file mode 100644 index 0000000..1b40268 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_ItemRequestBuilder.cs @@ -0,0 +1,150 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item +{ + /// + /// Builds and executes requests for operations under \v2\volumes\{volume_id}\actions\{action_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}/actions/{action_id}{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAction_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}/actions/{action_id}{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve the status of a volume action, send a GET request to `/v2/volumes/$VOLUME_ID/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithAction_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithAction_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of a volume action, send a GET request to `/v2/volumes/$VOLUME_ID/actions/$ACTION_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithAction_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the status of a volume action, send a GET request to `/v2/volumes/$VOLUME_ID/actions/$ACTION_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve the status of a volume action, send a GET request to `/v2/volumes/$VOLUME_ID/actions/$ACTION_ID`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithAction_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_Response.cs new file mode 100644 index 0000000..72d7f55 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Actions/Item/WithAction_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item +{ + [Obsolete("This class is obsolete. Use WithAction_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithAction_Response : global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.Item.WithAction_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsGetResponse.cs new file mode 100644 index 0000000..26d6272 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The snapshots property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Snapshots { get; set; } +#nullable restore +#else + public List Snapshots { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SnapshotsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "snapshots", n => { Snapshots = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Snapshots.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("snapshots", Snapshots); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsPostRequestBody.cs new file mode 100644 index 0000000..ab61caf --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsPostRequestBody.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A human-readable name for the volume snapshot. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SnapshotsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfPrimitiveValues("tags", Tags); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsPostResponse.cs new file mode 100644 index 0000000..81cbcc7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The snapshot property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Snapshots? Snapshot { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Snapshots Snapshot { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SnapshotsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "snapshot", n => { Snapshot = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Snapshots.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("snapshot", Snapshot); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsRequestBuilder.cs new file mode 100644 index 0000000..29f0e38 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsRequestBuilder.cs @@ -0,0 +1,251 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots +{ + /// + /// Builds and executes requests for operations under \v2\volumes\{volume_id}\snapshots + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}/snapshots{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}/snapshots{?page*,per_page*}", rawUrl) + { + } + /// + /// To retrieve the snapshots that have been created from a volume, send a GET request to `/v2/volumes/$VOLUME_ID/snapshots`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsSnapshotsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsSnapshotsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the snapshots that have been created from a volume, send a GET request to `/v2/volumes/$VOLUME_ID/snapshots`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsSnapshotsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a snapshot from a volume, sent a POST request to `/v2/volumes/$VOLUME_ID/snapshots`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsSnapshotsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsSnapshotsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a snapshot from a volume, sent a POST request to `/v2/volumes/$VOLUME_ID/snapshots`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsSnapshotsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the snapshots that have been created from a volume, send a GET request to `/v2/volumes/$VOLUME_ID/snapshots`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a snapshot from a volume, sent a POST request to `/v2/volumes/$VOLUME_ID/snapshots`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To retrieve the snapshots that have been created from a volume, send a GET request to `/v2/volumes/$VOLUME_ID/snapshots`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsResponse.cs new file mode 100644 index 0000000..529577a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/Snapshots/SnapshotsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots +{ + [Obsolete("This class is obsolete. Use SnapshotsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SnapshotsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_GetResponse.cs new file mode 100644 index 0000000..bc1698e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVolume_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The volume property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_full? Volume { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_full Volume { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVolume_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "volume", n => { Volume = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Volume_full.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("volume", Volume); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_ItemRequestBuilder.cs new file mode 100644 index 0000000..bf32ca6 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_ItemRequestBuilder.cs @@ -0,0 +1,206 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions; +using InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item +{ + /// + /// Builds and executes requests for operations under \v2\volumes\{volume_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVolume_ItemRequestBuilder : BaseRequestBuilder + { + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The snapshots property + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsRequestBuilder Snapshots + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.Snapshots.SnapshotsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithVolume_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithVolume_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/{volume_id}", rawUrl) + { + } + /// + /// To delete a block storage volume, destroying all data and removing it from your account, send a DELETE request to `/v2/volumes/$VOLUME_ID`.No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a block storage volume, send a GET request to `/v2/volumes/$VOLUME_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithVolume_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithVolume_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about a block storage volume, send a GET request to `/v2/volumes/$VOLUME_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithVolume_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a block storage volume, destroying all data and removing it from your account, send a DELETE request to `/v2/volumes/$VOLUME_ID`.No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about a block storage volume, send a GET request to `/v2/volumes/$VOLUME_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVolume_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVolume_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_Response.cs new file mode 100644 index 0000000..314ea6c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Item/WithVolume_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Item +{ + [Obsolete("This class is obsolete. Use WithVolume_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVolume_Response : global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_GetResponse.cs new file mode 100644 index 0000000..674ce11 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSnapshot_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The snapshot property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Snapshots? Snapshot { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Snapshots Snapshot { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithSnapshot_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "snapshot", n => { Snapshot = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Snapshots.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("snapshot", Snapshot); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_ItemRequestBuilder.cs new file mode 100644 index 0000000..cbf2071 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_ItemRequestBuilder.cs @@ -0,0 +1,194 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item +{ + /// + /// Builds and executes requests for operations under \v2\volumes\snapshots\{snapshot_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSnapshot_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSnapshot_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/snapshots/{snapshot_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSnapshot_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/snapshots/{snapshot_id}", rawUrl) + { + } + /// + /// To delete a volume snapshot, send a DELETE request to`/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the details of a snapshot that has been created from a volume, send a GET request to `/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithSnapshot_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithSnapshot_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To retrieve the details of a snapshot that has been created from a volume, send a GET request to `/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithSnapshot_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a volume snapshot, send a DELETE request to`/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID`.A status of 204 will be given. This indicates that the request was processedsuccessfully, but that no response body is needed. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To retrieve the details of a snapshot that has been created from a volume, send a GET request to `/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSnapshot_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSnapshot_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_Response.cs new file mode 100644 index 0000000..299563d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/Item/WithSnapshot_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item +{ + [Obsolete("This class is obsolete. Use WithSnapshot_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithSnapshot_Response : global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/SnapshotsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/SnapshotsRequestBuilder.cs new file mode 100644 index 0000000..7a29195 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/Snapshots/SnapshotsRequestBuilder.cs @@ -0,0 +1,48 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots +{ + /// + /// Builds and executes requests for operations under \v2\volumes\snapshots + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SnapshotsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.volumes.snapshots.item collection + /// The unique identifier for the snapshot. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("snapshot_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.Item.WithSnapshot_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/snapshots", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SnapshotsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes/snapshots", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesGetResponse.cs new file mode 100644 index 0000000..5667208 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VolumesGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// Array of volumes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Volumes { get; set; } +#nullable restore +#else + public List Volumes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VolumesGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "volumes", n => { Volumes = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Volume_full.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("volumes", Volumes); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesPostResponse.cs new file mode 100644 index 0000000..6ced950 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VolumesPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The volume property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_full? Volume { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volume_full Volume { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VolumesPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "volume", n => { Volume = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Volume_full.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("volume", Volume); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesRequestBuilder.cs new file mode 100644 index 0000000..8bdc332 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesRequestBuilder.cs @@ -0,0 +1,454 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions; +using InfinityFlow.DigitalOcean.Client.V2.Volumes.Item; +using InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes +{ + /// + /// Builds and executes requests for operations under \v2\volumes + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VolumesRequestBuilder : BaseRequestBuilder + { + /// The actions property + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder Actions + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Actions.ActionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The snapshots property + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.SnapshotsRequestBuilder Snapshots + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Snapshots.SnapshotsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.volumes.item collection + /// The ID of the block storage volume. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("volume_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.volumes.item collection + /// The ID of the block storage volume. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("volume_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.Item.WithVolume_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VolumesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes{?name*,page*,per_page*,region*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public VolumesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/volumes{?name*,page*,per_page*,region*}", rawUrl) + { + } + /// + /// Block storage volumes may also be deleted by name by sending a DELETE request with the volume's **name** and the **region slug** for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME&region=nyc1`.No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the block storage volumes available on your account, send a GET request to `/v2/volumes`.## Filtering Results### By RegionThe `region` may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: `/v2/volumes?region=nyc1`### By NameIt is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to `/v2/volumes?name=$VOLUME_NAME`.**Note:** You can only create one volume per region with the same name.### By Name and RegionIt is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME&region=nyc1`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsVolumesGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsVolumesGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the block storage volumes available on your account, send a GET request to `/v2/volumes`.## Filtering Results### By RegionThe `region` may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: `/v2/volumes?region=nyc1`### By NameIt is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to `/v2/volumes?name=$VOLUME_NAME`.**Note:** You can only create one volume per region with the same name.### By Name and RegionIt is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME&region=nyc1`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsVolumesGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new volume, send a POST request to `/v2/volumes`. Optionally, a `filesystem_type` attribute may be provided in order to automatically format the volume's filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsVolumesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsVolumesPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new volume, send a POST request to `/v2/volumes`. Optionally, a `filesystem_type` attribute may be provided in order to automatically format the volume's filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsVolumesPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Block storage volumes may also be deleted by name by sending a DELETE request with the volume's **name** and the **region slug** for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME&region=nyc1`.No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To list all of the block storage volumes available on your account, send a GET request to `/v2/volumes`.## Filtering Results### By RegionThe `region` may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: `/v2/volumes?region=nyc1`### By NameIt is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to `/v2/volumes?name=$VOLUME_NAME`.**Note:** You can only create one volume per region with the same name.### By Name and RegionIt is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME&region=nyc1`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new volume, send a POST request to `/v2/volumes`. Optionally, a `filesystem_type` attribute may be provided in order to automatically format the volume's filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes , + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VolumesPostRequestBody : IComposedTypeWrapper, IParsable + { + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volumes_ext4? VolumesExt4 { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volumes_ext4 VolumesExt4 { get; set; } +#endif + /// Composed type representation for type +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Volumes_xfs? VolumesXfs { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Volumes_xfs VolumesXfs { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesRequestBuilder.VolumesPostRequestBody(); + result.VolumesExt4 = new global::InfinityFlow.DigitalOcean.Client.Models.Volumes_ext4(); + result.VolumesXfs = new global::InfinityFlow.DigitalOcean.Client.Models.Volumes_xfs(); + return result; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + if(VolumesExt4 != null || VolumesXfs != null) + { + return ParseNodeHelper.MergeDeserializersForIntersectionWrapper(VolumesExt4, VolumesXfs); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue(null, VolumesExt4, VolumesXfs); + } + } + /// + /// Block storage volumes may also be deleted by name by sending a DELETE request with the volume's **name** and the **region slug** for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME&region=nyc1`.No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VolumesRequestBuilderDeleteQueryParameters + { + /// The block storage volume's name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// The slug identifier for the region where the resource is available. + [Obsolete("This property is deprecated, use RegionAsRegionSlug instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("region")] + public string? Region { get; set; } +#nullable restore +#else + [QueryParameter("region")] + public string Region { get; set; } +#endif + /// The slug identifier for the region where the resource is available. + [QueryParameter("region")] + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? RegionAsRegionSlug { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VolumesRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// To list all of the block storage volumes available on your account, send a GET request to `/v2/volumes`.## Filtering Results### By RegionThe `region` may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: `/v2/volumes?region=nyc1`### By NameIt is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to `/v2/volumes?name=$VOLUME_NAME`.**Note:** You can only create one volume per region with the same name.### By Name and RegionIt is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME&region=nyc1`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VolumesRequestBuilderGetQueryParameters + { + /// The block storage volume's name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// The slug identifier for the region where the resource is available. + [Obsolete("This property is deprecated, use RegionAsRegionSlug instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("region")] + public string? Region { get; set; } +#nullable restore +#else + [QueryParameter("region")] + public string Region { get; set; } +#endif + /// The slug identifier for the region where the resource is available. + [QueryParameter("region")] + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? RegionAsRegionSlug { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VolumesRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VolumesRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesResponse.cs new file mode 100644 index 0000000..3cab6a5 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Volumes/VolumesResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Volumes +{ + [Obsolete("This class is obsolete. Use VolumesGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VolumesResponse : global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Volumes.VolumesResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_DeleteResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_DeleteResponse.cs new file mode 100644 index 0000000..c7ebda3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_DeleteResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_DeleteResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc_peering property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering? VpcPeering { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering VpcPeering { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_peering_DeleteResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_DeleteResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_DeleteResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc_peering", n => { VpcPeering = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc_peering", VpcPeering); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_GetResponse.cs new file mode 100644 index 0000000..02b95e8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc_peering property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering? VpcPeering { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering VpcPeering { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_peering_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc_peering", n => { VpcPeering = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc_peering", VpcPeering); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_ItemRequestBuilder.cs new file mode 100644 index 0000000..19a2555 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_ItemRequestBuilder.cs @@ -0,0 +1,324 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item +{ + /// + /// Builds and executes requests for operations under \v2\vpc_peerings\{vpc_peering_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_peering_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithVpc_peering_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpc_peerings/{vpc_peering_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithVpc_peering_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpc_peerings/{vpc_peering_id}", rawUrl) + { + } + /// + /// To delete a VPC peering, send a DELETE request to `/v2/vpc_peerings/$VPC_PEERING_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsWithVpc_peering_DeleteResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsWithVpc_peering_DeleteResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_DeleteResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a VPC peering, send a DELETE request to `/v2/vpc_peerings/$VPC_PEERING_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use DeleteAsWithVpc_peering_DeleteResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing VPC Peering, send a GET request to `/v2/vpc_peerings/$VPC_PEERING_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithVpc_peering_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithVpc_peering_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing VPC Peering, send a GET request to `/v2/vpc_peerings/$VPC_PEERING_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithVpc_peering_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of a VPC peering, send a PATCH request to `/v2/vpc_peerings/$VPC_PEERING_ID` with the new `name` in the request body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsWithVpc_peering_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsWithVpc_peering_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of a VPC peering, send a PATCH request to `/v2/vpc_peerings/$VPC_PEERING_ID` with the new `name` in the request body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PatchAsWithVpc_peering_PatchResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a VPC peering, send a DELETE request to `/v2/vpc_peerings/$VPC_PEERING_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing VPC Peering, send a GET request to `/v2/vpc_peerings/$VPC_PEERING_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update the name of a VPC peering, send a PATCH request to `/v2/vpc_peerings/$VPC_PEERING_ID` with the new `name` in the request body. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_peering_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_peering_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_peering_ItemRequestBuilderPatchRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_PatchRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_PatchRequestBody.cs new file mode 100644 index 0000000..a4e8243 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_PatchRequestBody.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_PatchRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering_updatable, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_PatchResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_PatchResponse.cs new file mode 100644 index 0000000..30b680e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_PatchResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_PatchResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc_peering property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering? VpcPeering { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering VpcPeering { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_peering_PatchResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_PatchResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc_peering", n => { VpcPeering = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc_peering", VpcPeering); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_Response.cs new file mode 100644 index 0000000..6be8079 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Item/WithVpc_peering_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item +{ + [Obsolete("This class is obsolete. Use WithVpc_peering_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_Response : global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsGetResponse.cs new file mode 100644 index 0000000..d63a1a1 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc_peeringsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The vpc_peerings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VpcPeerings { get; set; } +#nullable restore +#else + public List VpcPeerings { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Vpc_peeringsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "vpc_peerings", n => { VpcPeerings = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("vpc_peerings", VpcPeerings); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsPostRequestBody.cs new file mode 100644 index 0000000..deff95d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsPostRequestBody.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc_peeringsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// An array of the two peered VPCs IDs. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? VpcIds { get; set; } +#nullable restore +#else + public List VpcIds { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Vpc_peeringsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "vpc_ids", n => { VpcIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfPrimitiveValues("vpc_ids", VpcIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsPostResponse.cs new file mode 100644 index 0000000..7ef3da0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc_peeringsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc_peering property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering? VpcPeering { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering VpcPeering { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Vpc_peeringsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc_peering", n => { VpcPeering = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc_peering", VpcPeering); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsRequestBuilder.cs new file mode 100644 index 0000000..a7d4a30 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsRequestBuilder.cs @@ -0,0 +1,283 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings +{ + /// + /// Builds and executes requests for operations under \v2\vpc_peerings + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Vpc_peeringsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.vpc_peerings.item collection + /// A unique identifier for a VPC peering. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("vpc_peering_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.vpc_peerings.item collection + /// A unique identifier for a VPC peering. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("vpc_peering_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Item.WithVpc_peering_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Vpc_peeringsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpc_peerings{?page*,per_page*,region*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Vpc_peeringsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpc_peerings{?page*,per_page*,region*}", rawUrl) + { + } + /// + /// To list all of the VPC peerings on your account, send a GET request to `/v2/vpc_peerings`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsVpc_peeringsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsVpc_peeringsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the VPC peerings on your account, send a GET request to `/v2/vpc_peerings`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsVpc_peeringsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new VPC Peering, send a POST request to `/v2/vpc_peerings` specifying a name and a list of two VPC IDs to peer. The response code, 202 Accepted, does not indicate the success or failure of the operation, just that the request has been accepted for processing. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsVpc_peeringsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsVpc_peeringsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new VPC Peering, send a POST request to `/v2/vpc_peerings` specifying a name and a list of two VPC IDs to peer. The response code, 202 Accepted, does not indicate the success or failure of the operation, just that the request has been accepted for processing. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsVpc_peeringsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the VPC peerings on your account, send a GET request to `/v2/vpc_peerings`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new VPC Peering, send a POST request to `/v2/vpc_peerings` specifying a name and a list of two VPC IDs to peer. The response code, 202 Accepted, does not indicate the success or failure of the operation, just that the request has been accepted for processing. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the VPC peerings on your account, send a GET request to `/v2/vpc_peerings`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Vpc_peeringsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// The slug identifier for the region where the resource is available. + [Obsolete("This property is deprecated, use RegionAsRegionSlug instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("region")] + public string? Region { get; set; } +#nullable restore +#else + [QueryParameter("region")] + public string Region { get; set; } +#endif + /// The slug identifier for the region where the resource is available. + [QueryParameter("region")] + public global::InfinityFlow.DigitalOcean.Client.Models.Region_slug? RegionAsRegionSlug { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Vpc_peeringsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class Vpc_peeringsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsResponse.cs new file mode 100644 index 0000000..5be6e57 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpc_peerings/Vpc_peeringsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings +{ + [Obsolete("This class is obsolete. Use Vpc_peeringsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class Vpc_peeringsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpc_peerings.Vpc_peeringsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersGetResponse.cs new file mode 100644 index 0000000..840284c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class MembersGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The members property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Members { get; set; } +#nullable restore +#else + public List Members { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MembersGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "members", n => { Members = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_member.CreateFromDiscriminatorValue)?.AsList(); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteCollectionOfObjectValues("members", Members); + writer.WriteObjectValue("meta", Meta); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersRequestBuilder.cs new file mode 100644 index 0000000..199efe4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersRequestBuilder.cs @@ -0,0 +1,160 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members +{ + /// + /// Builds and executes requests for operations under \v2\vpcs\{vpc_id}\members + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MembersRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MembersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}/members{?page*,per_page*,resource_type*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MembersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}/members{?page*,per_page*,resource_type*}", rawUrl) + { + } + /// + /// To list all of the resources that are members of a VPC, send a GET request to`/v2/vpcs/$VPC_ID/members`.To only list resources of a specific type that are members of the VPC,included a `resource_type` query parameter. For example, to only list Dropletsin the VPC, send a GET request to `/v2/vpcs/$VPC_ID/members?resource_type=droplet`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsMembersGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsMembersGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the resources that are members of a VPC, send a GET request to`/v2/vpcs/$VPC_ID/members`.To only list resources of a specific type that are members of the VPC,included a `resource_type` query parameter. For example, to only list Dropletsin the VPC, send a GET request to `/v2/vpcs/$VPC_ID/members?resource_type=droplet`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsMembersGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the resources that are members of a VPC, send a GET request to`/v2/vpcs/$VPC_ID/members`.To only list resources of a specific type that are members of the VPC,included a `resource_type` query parameter. For example, to only list Dropletsin the VPC, send a GET request to `/v2/vpcs/$VPC_ID/members?resource_type=droplet`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the resources that are members of a VPC, send a GET request to`/v2/vpcs/$VPC_ID/members`.To only list resources of a specific type that are members of the VPC,included a `resource_type` query parameter. For example, to only list Dropletsin the VPC, send a GET request to `/v2/vpcs/$VPC_ID/members?resource_type=droplet`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MembersRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// Used to filter VPC members by a resource type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("resource_type")] + public string? ResourceType { get; set; } +#nullable restore +#else + [QueryParameter("resource_type")] + public string ResourceType { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MembersRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersResponse.cs new file mode 100644 index 0000000..a295bec --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Members/MembersResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members +{ + [Obsolete("This class is obsolete. Use MembersGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class MembersResponse : global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_ItemRequestBuilder.cs new file mode 100644 index 0000000..fed6bc8 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_ItemRequestBuilder.cs @@ -0,0 +1,144 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item +{ + /// + /// Builds and executes requests for operations under \v2\vpcs\{vpc_id}\peerings\{vpc_peering_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_peering_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithVpc_peering_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}/peerings/{vpc_peering_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithVpc_peering_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}/peerings/{vpc_peering_id}", rawUrl) + { + } + /// + /// To update the name of a VPC peering in a particular VPC, send a PATCH request to `/v2/vpcs/$VPC_ID/peerings/$VPC_PEERING_ID` with the new `name` in the request body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsWithVpc_peering_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsWithVpc_peering_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of a VPC peering in a particular VPC, send a PATCH request to `/v2/vpcs/$VPC_ID/peerings/$VPC_PEERING_ID` with the new `name` in the request body. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PatchAsWithVpc_peering_PatchResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update the name of a VPC peering in a particular VPC, send a PATCH request to `/v2/vpcs/$VPC_ID/peerings/$VPC_PEERING_ID` with the new `name` in the request body. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_peering_ItemRequestBuilderPatchRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_PatchRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_PatchRequestBody.cs new file mode 100644 index 0000000..300a571 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_PatchRequestBody.cs @@ -0,0 +1,47 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_PatchRequestBody : global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering_updatable, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_PatchResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_PatchResponse.cs new file mode 100644 index 0000000..2d00d23 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_PatchResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_PatchResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The peering property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering? Peering { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering Peering { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_peering_PatchResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "peering", n => { Peering = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("peering", Peering); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_Response.cs new file mode 100644 index 0000000..0009753 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/Item/WithVpc_peering_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item +{ + [Obsolete("This class is obsolete. Use WithVpc_peering_PatchResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_peering_Response : global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_PatchResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsGetResponse.cs new file mode 100644 index 0000000..30c6864 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PeeringsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The peerings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Peerings { get; set; } +#nullable restore +#else + public List Peerings { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PeeringsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "peerings", n => { Peerings = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("peerings", Peerings); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsPostRequestBody.cs new file mode 100644 index 0000000..d47fc06 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsPostRequestBody.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PeeringsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the VPC peering. Must be unique and may only contain alphanumeric characters, dashes, and periods. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The ID of the VPC to peer with. + public Guid? VpcId { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public PeeringsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "vpc_id", n => { VpcId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteGuidValue("vpc_id", VpcId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsPostResponse.cs new file mode 100644 index 0000000..5304db4 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PeeringsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The peering property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering? Peering { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering Peering { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PeeringsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "peering", n => { Peering = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc_peering.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("peering", Peering); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsRequestBuilder.cs new file mode 100644 index 0000000..43a8d5c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsRequestBuilder.cs @@ -0,0 +1,273 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings +{ + /// + /// Builds and executes requests for operations under \v2\vpcs\{vpc_id}\peerings + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PeeringsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.vpcs.item.peerings.item collection + /// A unique identifier for a VPC peering. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("vpc_peering_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.vpcs.item.peerings.item collection + /// A unique identifier for a VPC peering. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("vpc_peering_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.Item.WithVpc_peering_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PeeringsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}/peerings{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PeeringsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}/peerings{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of a VPC's peerings, send a GET request to`/v2/vpcs/$VPC_ID/peerings`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsPeeringsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsPeeringsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a VPC's peerings, send a GET request to`/v2/vpcs/$VPC_ID/peerings`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsPeeringsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new VPC peering for a given VPC, send a POST request to`/v2/vpcs/$VPC_ID/peerings`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsPeeringsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsPeeringsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a new VPC peering for a given VPC, send a POST request to`/v2/vpcs/$VPC_ID/peerings`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsPeeringsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of a VPC's peerings, send a GET request to`/v2/vpcs/$VPC_ID/peerings`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a new VPC peering for a given VPC, send a POST request to`/v2/vpcs/$VPC_ID/peerings`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of a VPC's peerings, send a GET request to`/v2/vpcs/$VPC_ID/peerings`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PeeringsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PeeringsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PeeringsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsResponse.cs new file mode 100644 index 0000000..df36de0 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/Peerings/PeeringsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings +{ + [Obsolete("This class is obsolete. Use PeeringsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PeeringsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_GetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_GetResponse.cs new file mode 100644 index 0000000..be574a3 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_GetResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_GetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc? Vpc { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc Vpc { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_GetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_GetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_GetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc", n => { Vpc = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc", Vpc); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_ItemRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_ItemRequestBuilder.cs new file mode 100644 index 0000000..9438032 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_ItemRequestBuilder.cs @@ -0,0 +1,400 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members; +using InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item +{ + /// + /// Builds and executes requests for operations under \v2\vpcs\{vpc_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_ItemRequestBuilder : BaseRequestBuilder + { + /// The members property + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersRequestBuilder Members + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Members.MembersRequestBuilder(PathParameters, RequestAdapter); + } + /// The peerings property + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsRequestBuilder Peerings + { + get => new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.Peerings.PeeringsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithVpc_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithVpc_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs/{vpc_id}", rawUrl) + { + } + /// + /// To delete a VPC, send a DELETE request to `/v2/vpcs/$VPC_ID`. A 204 statuscode with no body will be returned in response to a successful request.The default VPC for a region can not be deleted. Additionally, a VPC can onlybe deleted if it does not contain any member resources. Attempting to deletea region's default VPC or a VPC that still has members will result in a403 Forbidden error response. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing VPC, send a GET request to `/v2/vpcs/$VPC_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsWithVpc_GetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsWithVpc_GetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_GetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To show information about an existing VPC, send a GET request to `/v2/vpcs/$VPC_ID`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsWithVpc_GetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a subset of information about a VPC, send a PATCH request to`/v2/vpcs/$VPC_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsWithVpc_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsWithVpc_PatchResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update a subset of information about a VPC, send a PATCH request to`/v2/vpcs/$VPC_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PatchAsWithVpc_PatchResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update information about a VPC, send a PUT request to `/v2/vpcs/$VPC_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsWithVpc_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsWithVpc_PutResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To update information about a VPC, send a PUT request to `/v2/vpcs/$VPC_ID`. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PutAsWithVpc_PutResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_Response.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To delete a VPC, send a DELETE request to `/v2/vpcs/$VPC_ID`. A 204 statuscode with no body will be returned in response to a successful request.The default VPC for a region can not be deleted. Additionally, a VPC can onlybe deleted if it does not contain any member resources. Attempting to deletea region's default VPC or a VPC that still has members will result in a403 Forbidden error response. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To show information about an existing VPC, send a GET request to `/v2/vpcs/$VPC_ID`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To update a subset of information about a VPC, send a PATCH request to`/v2/vpcs/$VPC_ID`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// To update information about a VPC, send a PUT request to `/v2/vpcs/$VPC_ID`. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_ItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_ItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_ItemRequestBuilderPatchRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVpc_ItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PatchRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PatchRequestBody.cs new file mode 100644 index 0000000..2417c46 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PatchRequestBody.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_PatchRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether or not the VPC is the default network for the region. All applicable resources are placed into the default VPC network unless otherwise specified during their creation. The `default` field cannot be unset from `true`. If you want to set a new default VPC network, update the `default` field of another VPC network in the same region. The previous network's `default` field will be set to `false` when a new default VPC has been defined. + public bool? Default { get; set; } + /// A free-form text field for describing the VPC's purpose. It may be a maximum of 255 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The name of the VPC. Must be unique and may only contain alphanumeric characters, dashes, and periods. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_PatchRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "default", n => { Default = n.GetBoolValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("default", Default); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PatchResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PatchResponse.cs new file mode 100644 index 0000000..8a42c0e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PatchResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_PatchResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc? Vpc { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc Vpc { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_PatchResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PatchResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc", n => { Vpc = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc", Vpc); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PutRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PutRequestBody.cs new file mode 100644 index 0000000..4933aa7 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PutRequestBody.cs @@ -0,0 +1,79 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_PutRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A boolean value indicating whether or not the VPC is the default network for the region. All applicable resources are placed into the default VPC network unless otherwise specified during their creation. The `default` field cannot be unset from `true`. If you want to set a new default VPC network, update the `default` field of another VPC network in the same region. The previous network's `default` field will be set to `false` when a new default VPC has been defined. + public bool? Default { get; set; } + /// A free-form text field for describing the VPC's purpose. It may be a maximum of 255 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The name of the VPC. Must be unique and may only contain alphanumeric characters, dashes, and periods. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_PutRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "default", n => { Default = n.GetBoolValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("default", Default); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PutResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PutResponse.cs new file mode 100644 index 0000000..c52c403 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_PutResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_PutResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc? Vpc { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc Vpc { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithVpc_PutResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_PutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc", n => { Vpc = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc", Vpc); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_Response.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_Response.cs new file mode 100644 index 0000000..828229e --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/Item/WithVpc_Response.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item +{ + [Obsolete("This class is obsolete. Use WithVpc_GetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class WithVpc_Response : global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_GetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_Response CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_Response(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsGetResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsGetResponse.cs new file mode 100644 index 0000000..e7286aa --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsGetResponse.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VpcsGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links? Links { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Page_links Links { get; set; } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties? Meta { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties Meta { get; set; } +#endif + /// The vpcs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Vpcs { get; set; } +#nullable restore +#else + public List Vpcs { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VpcsGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "links", n => { Links = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Page_links.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Meta_properties.CreateFromDiscriminatorValue); } }, + { "vpcs", n => { Vpcs = n.GetCollectionOfObjectValues(global::InfinityFlow.DigitalOcean.Client.Models.Vpc.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("vpcs", Vpcs); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsPostRequestBody.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsPostRequestBody.cs new file mode 100644 index 0000000..20399ba --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsPostRequestBody.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VpcsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A free-form text field for describing the VPC's purpose. It may be a maximum of 255 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The range of IP addresses in the VPC in CIDR notation. Network ranges cannot overlap with other networks in the same account and must be in range of private addresses as defined in RFC1918. It may not be smaller than `/28` nor larger than `/16`. If no IP range is specified, a `/20` network range is generated that won't conflict with other VPC networks in your account. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IpRange { get; set; } +#nullable restore +#else + public string IpRange { get; set; } +#endif + /// The name of the VPC. Must be unique and may only contain alphanumeric characters, dashes, and periods. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The slug identifier for the region where the VPC will be created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Region { get; set; } +#nullable restore +#else + public string Region { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VpcsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "description", n => { Description = n.GetStringValue(); } }, + { "ip_range", n => { IpRange = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "region", n => { Region = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("ip_range", IpRange); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("region", Region); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsPostResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsPostResponse.cs new file mode 100644 index 0000000..e1c2d10 --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsPostResponse.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VpcsPostResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The vpc property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc? Vpc { get; set; } +#nullable restore +#else + public global::InfinityFlow.DigitalOcean.Client.Models.Vpc Vpc { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VpcsPostResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "vpc", n => { Vpc = n.GetObjectValue(global::InfinityFlow.DigitalOcean.Client.Models.Vpc.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("vpc", Vpc); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsRequestBuilder.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsRequestBuilder.cs new file mode 100644 index 0000000..ce5c73d --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsRequestBuilder.cs @@ -0,0 +1,269 @@ +// +#pragma warning disable CS0618 +using InfinityFlow.DigitalOcean.Client.Models; +using InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs +{ + /// + /// Builds and executes requests for operations under \v2\vpcs + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VpcsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.vpcs.item collection + /// A unique identifier for a VPC. + /// A + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_ItemRequestBuilder this[Guid position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("vpc_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the InfinityFlow.DigitalOcean.Client.v2.vpcs.item collection + /// A unique identifier for a VPC. + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_ItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("vpc_id", position); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.Item.WithVpc_ItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VpcsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs{?page*,per_page*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public VpcsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/vpcs{?page*,per_page*}", rawUrl) + { + } + /// + /// To list all of the VPCs on your account, send a GET request to `/v2/vpcs`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsVpcsGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsVpcsGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the VPCs on your account, send a GET request to `/v2/vpcs`. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsVpcsGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "404", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a VPC, send a POST request to `/v2/vpcs` specifying the attributesin the table below in the JSON body.**Note:** If you do not currently have a VPC network in a specific datacenterregion, the first one that you create will be set as the default for thatregion. The default VPC for a region cannot be changed or deleted. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsVpcsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsVpcsPostResponseAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To create a VPC, send a POST request to `/v2/vpcs` specifying the attributesin the table below in the JSON body.**Note:** If you do not currently have a VPC network in a specific datacenterregion, the first one that you create will be set as the default for thatregion. The default VPC for a region cannot be changed or deleted. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 429 status code + /// When receiving a 500 status code + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use PostAsVpcsPostResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "429", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "500", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + { "XXX", global::InfinityFlow.DigitalOcean.Client.Models.Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// To list all of the VPCs on your account, send a GET request to `/v2/vpcs`. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// To create a VPC, send a POST request to `/v2/vpcs` specifying the attributesin the table below in the JSON body.**Note:** If you do not currently have a VPC network in a specific datacenterregion, the first one that you create will be set as the default for thatregion. The default VPC for a region cannot be changed or deleted. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsRequestBuilder WithUrl(string rawUrl) + { + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// To list all of the VPCs on your account, send a GET request to `/v2/vpcs`. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VpcsRequestBuilderGetQueryParameters + { + /// Which 'page' of paginated results to return. + [QueryParameter("page")] + public int? Page { get; set; } + /// Number of items returned per page + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VpcsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VpcsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsResponse.cs b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsResponse.cs new file mode 100644 index 0000000..c10032a --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/V2/Vpcs/VpcsResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace InfinityFlow.DigitalOcean.Client.V2.Vpcs +{ + [Obsolete("This class is obsolete. Use VpcsGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class VpcsResponse : global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::InfinityFlow.DigitalOcean.Client.V2.Vpcs.VpcsResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/InfinityFlow.DigitalOcean.Client/kiota-lock.json b/src/InfinityFlow.DigitalOcean.Client/kiota-lock.json new file mode 100644 index 0000000..579575c --- /dev/null +++ b/src/InfinityFlow.DigitalOcean.Client/kiota-lock.json @@ -0,0 +1,34 @@ +{ + "descriptionHash": "A2F3F24E0556D630B3D64EDA686CAF24B00E74969DF4D559827B8C2974A10CB3B00AADC1DA1E1BBAC8EFAA40D400F2D8456DFE7E1BDF8755EFF400A5A352D355", + "descriptionLocation": "https://api-engineering.nyc3.cdn.digitaloceanspaces.com/spec-ci/DigitalOcean-public.v2.yaml", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.20.0", + "clientClassName": "DigitalOceanClient", + "typeAccessModifier": "Public", + "clientNamespaceName": "InfinityFlow.DigitalOcean.Client", + "language": "CSharp", + "usesBackingStore": false, + "excludeBackwardCompatible": false, + "includeAdditionalData": true, + "disableSSLValidation": false, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory" + ], + "deserializers": [ + "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory", + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} \ No newline at end of file diff --git a/test/Directory.Build.props b/test/Directory.Build.props new file mode 100644 index 0000000..085ef3a --- /dev/null +++ b/test/Directory.Build.props @@ -0,0 +1,43 @@ + + + + + + false + true + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/test/InfinityFlow.DigitalOcean.Client.Tests/InfinityFlow.DigitalOcean.Client.Tests.csproj b/test/InfinityFlow.DigitalOcean.Client.Tests/InfinityFlow.DigitalOcean.Client.Tests.csproj new file mode 100644 index 0000000..4f769d1 --- /dev/null +++ b/test/InfinityFlow.DigitalOcean.Client.Tests/InfinityFlow.DigitalOcean.Client.Tests.csproj @@ -0,0 +1,16 @@ +ο»Ώ + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + +