docs: async def write_pairwise(
              self,
              their_did: str,
              their_verkey: str = None,
              my_did: str = None,
              metadata: dict = None,
              replace_meta: bool = False) -> PairwiseInfo:
          """
          Store a pairwise DID for a secure connection. Use verification key for local DID in wallet if
          supplied; otherwise, create one first. If local DID specified but not present, raise AbsentRecord.
  
          With supplied metadata, replace or augment and overwrite any existing metadata for the pairwise
          relation if one already exists in the wallet. Always include local and remote DIDs and keys in
          metadata to allow for WQL search.
  
          Raise AbsentRecord on call to update a non-existent record. Raise BadRecord if metadata does not
          coerce into non-secrets API tags specification {str:str}.
  
          :param their_did: remote DID
          :param their_verkey: remote verification key (default None is OK if updating an existing pairwise DID)
          :param my_did: local DID
          :param metadata: metadata for pairwise connection
          :param replace_meta: whether to (True) replace or (False) augment and overwrite existing metadata
          :return: resulting PairwiseInfo
          """
  
          LOGGER.debug(
              'Wallet.write_pairwise >>> their_did: %s, their_verkey: %s, my_did: %s, metadata: %s, replace_meta: %s',
              their_did,
              their_verkey,
              my_did,
              metadata,
              replace_meta)
  
          if their_verkey is None:
              match = await self.get_pairwise(their_did)
              if not match:
                  LOGGER.debug(
                      'Wallet.write_pairwise <!< Wallet %s has no pairwise DID on %s to update',
                      self.name,
                      their_did)
                  raise AbsentRecord('Wallet {} has no pairwise DID on {} to update'.format(self.name, their_did))
              their_verkey = [pwise for pwise in match.values()][0].their_verkey
  
          try:
              await did.store_their_did(self.handle, json.dumps({'did': their_did, 'verkey': their_verkey}))
          except IndyError as x_indy:
              if x_indy.error_code == ErrorCode.WalletItemAlreadyExists:
                  pass  # exists already, carry on
              else:
                  LOGGER.debug(
                      'Wallet.write_pairwise <!< Wallet %s write of their_did %s raised indy error code %s',
                      self.name,
                      their_did,
                      x_indy.error_code)
                  raise
  
          if my_did:
              my_did_info = await self.get_local_did(my_did)  # raises AbsentRecord if no such local did
          else:
              my_did_info = await self.create_local_did(None, None, {'pairwise_for': their_did})
  
          pairwise = PairwiseInfo(their_did, their_verkey, my_did_info.did, my_did_info.verkey, metadata)
          try:
              storec = await self.write_non_secret(
                  StorageRecord(TYPE_PAIRWISE, their_verkey, tags=pairwise_info2tags(pairwise), ident=their_did),
                  replace_meta)
          except BadRecord:
              LOGGER.debug(
                  'Wallet.write_pairwise <!< Pairwise metadata %s does not coerce into flat {str:str} tags dict',
                  pairwise.metadata)
              raise
  
          rv = storage_record2pairwise_info(storec)
          LOGGER.debug('Wallet.write_pairwise <<< %s', rv)
          return rv