original_docstring: 
      .. versionadded:: 4.0.0
  
      Generates and returns a public/private key pair and populates the SSH public key resource with the public key.
      The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource.
  
      :param name: The name of the SSH public key.
  
      :param resource_group: The name of the resource group name assigned to the SSH public key.
  
      CLI Example:
  
      .. code-block:: bash
  
          azurerm.compute.ssh_public_key.generate_key_pair test_name test_group
  
      
docstring: : 4.0.0
  Generates and returns a public/private key pair and populates the SSH public key resource with the public key.
  The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource.
docstring_tokens: : 4 . 0 . 0 Generates and returns a public / private key pair and populates the SSH public key resource with the public key . The length of the key will be 3072 bits . This operation can only be performed once per SSH public key resource .
code: async def generate_key_pair(
      hub, ctx, name, resource_group, public_key=None, tags=None, **kwargs
  ):
      """
      .. versionadded:: 4.0.0
  
      Generates and returns a public/private key pair and populates the SSH public key resource with the public key.
      The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource.
  
      :param name: The name of the SSH public key.
  
      :param resource_group: The name of the resource group name assigned to the SSH public key.
  
      CLI Example:
  
      .. code-block:: bash
  
          azurerm.compute.ssh_public_key.generate_key_pair test_name test_group
  
      """
      if "location" not in kwargs:
          rg_props = await hub.exec.azurerm.resource.group.get(
              ctx, resource_group, **kwargs
          )
  
          if "error" in rg_props:
              log.error("Unable to determine location from resource group specified.")
              return {
                  "error": "Unable to determine location from resource group specified."
              }
          kwargs["location"] = rg_props["location"]
  
      result = {}
      compconn = await hub.exec.azurerm.utils.get_client(ctx, "compute", **kwargs)
  
      try:
          key = compconn.ssh_public_keys.generate_key_pair(
              resource_group_name=resource_group, ssh_public_key_name=name, **kwargs
          )
  
          result = key.as_dict()
      except CloudError as exc:
          await hub.exec.azurerm.utils.log_cloud_error("compute", str(exc), **kwargs)
          result = {"error": str(exc)}
      except SerializationError as exc:
          result = {
              "error": "The object model could not be parsed. ({0})".format(str(exc))
          }
  
      return result
code_tokens: async def generate_key_pair ( hub , ctx , name , resource_group , public_key = None , tags = None , ** kwargs ) : if "location" not in kwargs : rg_props = await hub . exec . azurerm . resource . group . get ( ctx , resource_group , ** kwargs ) if "error" in rg_props : log . error ( "Unable to determine location from resource group specified." ) return { "error" : "Unable to determine location from resource group specified." } kwargs [ "location" ] = rg_props [ "location" ] result = { } compconn = await hub . exec . azurerm . utils . get_client ( ctx , "compute" , ** kwargs ) try : key = compconn . ssh_public_keys . generate_key_pair ( resource_group_name = resource_group , ssh_public_key_name = name , ** kwargs ) result = key . as_dict ( ) except CloudError as exc : await hub . exec . azurerm . utils . log_cloud_error ( "compute" , str ( exc ) , ** kwargs ) result = { "error" : str ( exc ) } except SerializationError as exc : result = { "error" : "The object model could not be parsed. ({0})" . format ( str ( exc ) ) } return result
short_docstring: .. versionadded:: 4.0.0
  Generates and returns a public/private key pair and populates the SSH public key resource with the public key.
short_docstring_tokens: .. versionadded :: 4 . 0 . 0 Generates and returns a public / private key pair and populates the SSH public key resource with the public key .
comment: """
      .. versionadded:: 4.0.0
  
      Generates and returns a public/private key pair and populates the SSH public key resource with the public key.
      The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource.
  
      :param name: The name of the SSH public key.
  
      :param resource_group: The name of the resource group name assigned to the SSH public key.
  
      CLI Example:
  
      .. code-block:: bash
  
          azurerm.compute.ssh_public_key.generate_key_pair test_name test_group
  
      """