<commit_before>package gorp

import (
	"log"
	"os"
	"time"

	"github.com/gofrs/uuid"
)

func ExampleClient() {
	client := NewClient("http://dev.epm-rpp.projects.epam.com:8080", "default_personal", "cf37d519-d79a-4064-8110-c51f219baeae")

	launchUUID, _ := uuid.NewV4()
	launch, err := client.StartLaunch(&StartLaunchRQ{
		Mode: LaunchModes.Default,
		StartRQ: StartRQ{
			Name:        "gorp-test",
			UUID:        &launchUUID,
			StartTime:   Timestamp{Time: time.Now()},
			Description: "Demo Launch",
		},
	})
	checkErr(err, "unable to start launch")

	testUUID, _ := uuid.NewV4()
	_, err = client.StartTest(&StartTestRQ{
		LaunchID: launch.ID,
		CodeRef:  "example_test.go",
		UniqueID: "another one unique ID",
		Retry:    false,
		Type:     TestItemTypes.Test,
		StartRQ: StartRQ{
			Name:      "Gorp Test",
			StartTime: Timestamp{time.Now()},
			UUID:      &testUUID,
		},
	})
	checkErr(err, "unable to start test")

	log.Println("LAUNCHXXX")
	log.Println(launchUUID.String())

	_, err = client.SaveLog(&SaveLogRQ{
		LaunchUUID: launchUUID.String(),
		ItemID:     testUUID.String(),
		Level:      LogLevelInfo,
		LogTime:    Timestamp{time.Now()},
		Message:    "Log without binary",
	})
	checkErr(err, "unable to save log")

	file, _ := os.Open("../go.mod")
	_, err = client.SaveLogMultipart(&SaveLogRQ{
		LaunchUUID: launchUUID.String(),
		ItemID:     testUUID.String(),
		Level:      LogLevelInfo,
		Message:    "Log with binary",
	}, map[string]*os.File{"go.mod": file})

	checkErr(err, "unable to save log multipart")

	_, err = client.FinishTest(testUUID.String(), &FinishTestRQ{
		LaunchUUID: launchUUID.String(),
		FinishExecutionRQ: FinishExecutionRQ{
			EndTime: Timestamp{time.Now()},
			Status:  Statuses.Passed,
		},
	})
	checkErr(err, "unable to finish test")

	_, err = client.FinishLaunch(launchUUID.String(), &FinishExecutionRQ{
		Status:  Statuses.Passed,
		EndTime: Timestamp{time.Now()},
	})
	checkErr(err, "unable to finish launch")

	// Output:
}

func checkErr(err error, msg string) {
	if err != nil {
		log.Fatal(msg, err)
	}
}<commit_msg>fixes examples<commit_after>package gorp

import (
	"log"
	"os"
	"time"

	"github.com/gofrs/uuid"
)

func ExampleClient() {
	client := NewClient("xxx", "xxx", "xxx")

	launchUUID, _ := uuid.NewV4()
	launch, err := client.StartLaunch(&StartLaunchRQ{
		Mode: LaunchModes.Default,
		StartRQ: StartRQ{
			Name:        "gorp-test",
			UUID:        &launchUUID,
			StartTime:   Timestamp{Time: time.Now()},
			Description: "Demo Launch",
		},
	})
	checkErr(err, "unable to start launch")

	testUUID, _ := uuid.NewV4()
	_, err = client.StartTest(&StartTestRQ{
		LaunchID: launch.ID,
		CodeRef:  "example_test.go",
		UniqueID: "another one unique ID",
		Retry:    false,
		Type:     TestItemTypes.Test,
		StartRQ: StartRQ{
			Name:      "Gorp Test",
			StartTime: Timestamp{time.Now()},
			UUID:      &testUUID,
		},
	})
	checkErr(err, "unable to start test")

	log.Println("LAUNCHXXX")
	log.Println(launchUUID.String())

	_, err = client.SaveLog(&SaveLogRQ{
		LaunchUUID: launchUUID.String(),
		ItemID:     testUUID.String(),
		Level:      LogLevelInfo,
		LogTime:    Timestamp{time.Now()},
		Message:    "Log without binary",
	})
	checkErr(err, "unable to save log")

	file, _ := os.Open("../go.mod")
	_, err = client.SaveLogMultipart(&SaveLogRQ{
		LaunchUUID: launchUUID.String(),
		ItemID:     testUUID.String(),
		Level:      LogLevelInfo,
		Message:    "Log with binary",
	}, map[string]*os.File{"go.mod": file})

	checkErr(err, "unable to save log multipart")

	_, err = client.FinishTest(testUUID.String(), &FinishTestRQ{
		LaunchUUID: launchUUID.String(),
		FinishExecutionRQ: FinishExecutionRQ{
			EndTime: Timestamp{time.Now()},
			Status:  Statuses.Passed,
		},
	})
	checkErr(err, "unable to finish test")

	_, err = client.FinishLaunch(launchUUID.String(), &FinishExecutionRQ{
		Status:  Statuses.Passed,
		EndTime: Timestamp{time.Now()},
	})
	checkErr(err, "unable to finish launch")

}

func checkErr(err error, msg string) {
	if err != nil {
		log.Fatal(msg, err)
	}
}
{'fraction_non_alphanumeric': 0.15616506053867063, 'fraction_numerical': 0.006918705213738572, 'mean_word_length': 3.853717026378897, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2316810', 'n_tokens_mistral': 1646, 'n_tokens_neox': 1505, 'n_words': 300}