def update(type, name)
      resource_class = parse_type(type)
      client_setup
      fail_nice 'Must set the hash or json option' unless @options['hash'] || @options['json']
      fail_nice 'Must set the hash OR json option. Not both' if @options['hash'] && @options['json']
      begin
        data = @options['hash'] || JSON.parse(@options['json'])
      rescue JSON::ParserError => e
        fail_nice("Failed to parse json\n#{e.message}")
      end
      matches = resource_class.find_by(@client, name: name)
      fail_nice 'Not Found' if matches.empty?
      resource = matches.first
      begin
        resource.update(data)
        puts 'Updated Successfully!'
      rescue StandardError => e
        fail_nice "Failed to update #{resource.class.name.split('::').last} '#{name}': #{e}"
      end
    end
def update(type, name)
      resource_class = parse_type(type)
      client_setup
      fail_nice 'Must set the hash or json option' unless @options['hash'] || @options['json']
      fail_nice 'Must set the hash OR json option. Not both' if @options['hash'] && @options['json']
      begin
        data = @options['hash'] || JSON.parse(@options['json'])
      rescue JSON::ParserError => e
        fail_nice("Failed to parse json\n#{e.message}")
      end
      matches = resource_class.find_by(@client, name: name)
      fail_nice 'Not Found' if matches.empty?
      resource = matches.first
      begin
        resource.update(data)
        puts 'Updated Successfully!'
      rescue StandardError => e
        fail_nice "Failed to update #{resource.class.name.split('::').last} '#{name}': #{e}"
      end
    end
Update resource by name