<commit_before>package k8s

import (
	"context"
	"errors"

	"github.com/ericchiang/k8s/api/v1"
)

// ThirdPartyResources is a client used for interacting with user
// defined API groups. It uses JSON encoding instead of protobufs
// which are unsupported for these APIs.
//
// Users are expected to define their own third party resources.
//
//		const metricsResource = "metrics"
//
//		// First, define a third party resources with TypeMeta
//		// and ObjectMeta fields.
//		type Metric struct {
//			*unversioned.TypeMeta   `json:",inline"`
//			*v1.ObjectMeta          `json:"metadata,omitempty"`
//
//			Timestamp time.Time `json:"timestamp"`
//			Value     []byte    `json:"value"`
//		}
//
//		// Define a list wrapper.
//		type MetricsList struct {
//			*unversioned.TypeMeta `json:",inline"`
//			*unversioned.ListMeta `json:"metadata,omitempty"`
//
//			Items []Metric `json:"items"`
//		}
//
// Register the new resource by creating a ThirdPartyResource type.
//
//		// Create a ThirdPartyResource
//		tpr := &v1beta1.ThirdPartyResource{
//			Metadata: &v1.ObjectMeta{
//				Name: k8s.String("metric.metrics.example.com"),
//			},
//			Description: k8s.String("A custom third party resource"),
//			Versions:    []*v1beta1.APIVersions{
//				{Name: k8s.String("v1")},
//			},
//		}
//		_, err := client.ExtensionsV1Beta1().CreateThirdPartyResource(ctx, trp)
//		if err != nil {
//			// handle error<commit_msg>godoc: Fix typo in APIVersion struct usage<commit_after>package k8s

import (
	"context"
	"errors"

	"github.com/ericchiang/k8s/api/v1"
)

// ThirdPartyResources is a client used for interacting with user
// defined API groups. It uses JSON encoding instead of protobufs
// which are unsupported for these APIs.
//
// Users are expected to define their own third party resources.
//
//		const metricsResource = "metrics"
//
//		// First, define a third party resources with TypeMeta
//		// and ObjectMeta fields.
//		type Metric struct {
//			*unversioned.TypeMeta   `json:",inline"`
//			*v1.ObjectMeta          `json:"metadata,omitempty"`
//
//			Timestamp time.Time `json:"timestamp"`
//			Value     []byte    `json:"value"`
//		}
//
//		// Define a list wrapper.
//		type MetricsList struct {
//			*unversioned.TypeMeta `json:",inline"`
//			*unversioned.ListMeta `json:"metadata,omitempty"`
//
//			Items []Metric `json:"items"`
//		}
//
// Register the new resource by creating a ThirdPartyResource type.
//
//		// Create a ThirdPartyResource
//		tpr := &v1beta1.ThirdPartyResource{
//			Metadata: &v1.ObjectMeta{
//				Name: k8s.String("metric.metrics.example.com"),
//			},
//			Description: k8s.String("A custom third party resource"),
//			Versions:    []*v1beta1.APIVersion{
//				{Name: k8s.String("v1")},
//			},
//		}
//		_, err := client.ExtensionsV1Beta1().CreateThirdPartyResource(ctx, trp)
//		if err != nil {
//			// handle error
{'fraction_non_alphanumeric': 0.16283124128312412, 'fraction_numerical': 0.010460251046025104, 'mean_word_length': 2.8510067114093958, 'pattern_counts': {'":': 0, '<': 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': '5050810', 'n_tokens_mistral': 1035, 'n_tokens_neox': 978, 'n_words': 241}