# frozen_string_literal: true require_relative "base" module Neetob class CLI module Cloudflare class MinTlsVersion < Base attr_accessor :domain def initialize(domain) super() @domain = domain end def run zone_id = ZONE_IDS[domain.to_sym] raise(StandardError, "Domain '#{domain}' not found.") if zone_id.nil? url = create_url(zone_id, "settings/min_tls_version") response = get(url) tls_version = response[:result][:value] == "1.2" ? print_success(response[:result][:value]) : print_failure(response[:result][:value]) ui.info("Minimum TLS version is set to #{tls_version}") end end end end end