You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: plate_barcode.rb
    path of file: ./repos/sequencescape/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Class that handles the access to Baracoda to obtain new barcodes
class PlateBarcode
  def self.site
    configatron.baracoda_api
  end

  def self.prefix
    configatron.plate_barcode_prefix
  end

  # Creates a new single barcode in baracoda
  # Returns:
  # - Barcode instance, using Sequencescape22 format
  def self.create_barcode
    response = fetch_response("#{site}/barcodes/#{prefix}/new")
    Barcode.build_sequencescape22(response)
  end

  # Creates a new single barcode with a code text in baracoda
  # Arguments:
  # text - str with the code of up to 3 characters that will be appended
  # after the prefix
  # Returns:
  # - Barcode instance, using Sequencescape22 format
  def self.create_barcode_with_text(text)
    response = fetch_response("#{site}/barcodes/#{prefix}/new", { text: text })
    Barcode.build_sequencescape22(response)
  end

  # Creates a new group of child barcodes from a parent barcode.
  # Args:
  # - parent_barcode - String with the barcode we want to create children from
  # - count - Number o
    
    def self.create_barcode
      # We should use a different prefix for local so that you can switch between using baracoda
      # locally and there will not be clashes

      # We cache the last barcode so we don't get race conditions on generating barcodes
      # when requests appear at the same time
      Barcode.build_sequencescape22({ barcode: "#{prefix}-#{dev_cache_get_next_barcode}" })
    end

    def self.create_child_barcodes(parent_barcode, count = 1)
      child_barcodes = []

      current_child = Barcode.find_by_barcode(parent_barcode).child_barcodes.order(id: :desc).first

      # gets the 'child count' section of the barcode SQPD-12345-(1) as an int
      # if its the first child then current_child is blank and we set the count to 0
      current_child_count = current_child.blank? ? 0 : current_child.barcode.split('-').last.to_i

      # creates new child barcodes based on existing ones
      (1..count).each do |num|
        child_barcodes << Barcode.build_sequencescape22({ barcode: "#{parent_barcode}-#{current_child_count + num}" })
      end

      child_barcodes
    end
  end