<commit_before>package main

import (
	"encoding/xml"

	"github.com/mdigger/mx"
)

// Conference описывает параметры конференции.
type Conference struct {
	ID              string `xml:"confId" json:"Id"`
	OwnerID         mx.JID `xml:"ownerId" json:"ownerId"`
	Name            string `xml:"name" json:"name"`
	AccessID        int64  `xml:"accessId" json:"accessId"`
	Description     string `xml:"description" json:"description,omitempty"`
	Type            string `xml:"type" json:"type"`
	StartDate       int64  `xml:"startDate" json:"startDate"`
	Duration        int64  `xml:"duration" json:"duration"`
	WaitForOwner    bool   `xml:"waitForOwner" json:"waitForOwner"`
	DelOnOwnerLeave bool   `xml:"delOnOwnerLeave" json:"delOnOwnerLeave"`
	Ws              string `xml:"ws" json:"ws"`
	WsType          string `xml:"wsType" json:"wsType"`
}

// ConferenceCreate инициализирует новую конференцию.
func (c *MXConn) ConferenceCreate(params *Conference) (*Conference, error) {
	if _, err := c.SendWithResponse(&struct {
		XMLName xml.Name `xml:"CreateConference"`
		*Conference
	}{
		Conference: params,
	}); err != nil {
		return nil, err
	}
	err := c.HandleWait(func(resp *mx.Response) error {
		if err := resp.Decode(params); err != nil {
			return err
		}
		return mx.Stop
	}, mx.ReadTimeout, "ConfAddEvent")
	if err != nil {
		return nil, err
	}
	return params, nil
}

// ConferenceUpdate изменяет информацю о конференции.
func (c *MXConn) ConferenceUpdate(params *Conference) (*Conference, error) {
	if _, err := c.SendWithResponse(&struct {
		XMLName xml.Name `xml:"UpdateConference"`
		*Conference
	}{
		Conference: params,
	}); err != nil {
		return nil, err
	}
	err := c.HandleWait(func(resp *mx.Response) error {
		if err := resp.Decode(params); err != nil {
			return err
		}
		return mx.Stop
	}, mx.ReadTimeout, "ConfUpdEvent")
	if err != nil {
		return nil, err
	}
	return params, nil
}<commit_msg>DeleteConference<commit_after>package main

import (
	"encoding/xml"

	"github.com/mdigger/mx"
)

// Conference описывает параметры конференции.
type Conference struct {
	ID              string `xml:"confId" json:"Id"`
	OwnerID         mx.JID `xml:"ownerId" json:"ownerId"`
	Name            string `xml:"name" json:"name"`
	AccessID        int64  `xml:"accessId" json:"accessId"`
	Description     string `xml:"description" json:"description,omitempty"`
	Type            string `xml:"type" json:"type"`
	StartDate       int64  `xml:"startDate" json:"startDate"`
	Duration        int64  `xml:"duration" json:"duration"`
	WaitForOwner    bool   `xml:"waitForOwner" json:"waitForOwner"`
	DelOnOwnerLeave bool   `xml:"delOnOwnerLeave" json:"delOnOwnerLeave"`
	Ws              string `xml:"ws" json:"ws"`
	WsType          string `xml:"wsType" json:"wsType"`
}

// ConferenceCreate инициализирует новую конференцию.
func (c *MXConn) ConferenceCreate(params *Conference) (*Conference, error) {
	if _, err := c.SendWithResponse(&struct {
		XMLName xml.Name `xml:"CreateConference"`
		*Conference
	}{
		Conference: params,
	}); err != nil {
		return nil, err
	}
	err := c.HandleWait(func(resp *mx.Response) error {
		if err := resp.Decode(params); err != nil {
			return err
		}
		return mx.Stop
	}, mx.ReadTimeout, "ConfAddEvent")
	if err != nil {
		return nil, err
	}
	return params, nil
}

// ConferenceUpdate изменяет информацю о конференции.
func (c *MXConn) ConferenceUpdate(params *Conference) (*Conference, error) {
	if _, err := c.SendWithResponse(&struct {
		XMLName xml.Name `xml:"UpdateConference"`
		*Conference
	}{
		Conference: params,
	}); err != nil {
		return nil, err
	}
	err := c.HandleWait(func(resp *mx.Response) error {
		if err := resp.Decode(params); err != nil {
			return err
		}
		return mx.Stop
	}, mx.ReadTimeout, "ConfUpdEvent")
	if err != nil {
		return nil, err
	}
	return params, nil
}

// ConferenceDelete удаляет конфиренцию.
func (c *MXConn) ConferenceDelete(id string) error {
	if _, err := c.SendWithResponse(&struct {
		XMLName xml.Name `xml:"DeleteConference"`
		ID      string   `xml:"confId"`
	}{
		ID: id,
	}); err != nil {
		return err
	}
	return c.HandleWait(func(resp *mx.Response) error {
		return mx.Stop
	}, mx.ReadTimeout, "ConfDelEvent")
}
{'fraction_non_alphanumeric': 0.1390016718414139, 'fraction_numerical': 0.002866013852400287, 'mean_word_length': 3.6898096304591266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 37}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1916112', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1442, 'n_words': 350}