<commit_before>package kong

import (
	"fmt"
	"log"
	"net/http"

	"github.com/davecgh/go-spew/spew"
	"github.com/dghubble/sling"
	"github.com/hashicorp/terraform/helper/schema"
)

type KeyAuthCredential struct {
	ID       string `json:"id,omitempty"`
	Key      string `json:"key,omitempty"`
	Consumer string `json:"-"`
}

func resourceKongKeyAuthCredential() *schema.Resource {
	return &schema.Resource{
		Create: resourceKongKeyAuthCredentialCreate,
		Read:   resourceKongKeyAuthCredentialRead,
		Update: resourceKongKeyAuthCredentialUpdate,
		Delete: resourceKongKeyAuthCredentialDelete,

		Schema: map[string]*schema.Schema{
			"id": &schema.Schema{
				Type:     schema.TypeString,
				Computed: true,
			},

			"key": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				Description: "The key to use in the Key Authentication.",
			},

			"consumer": &schema.Schema{
				Type:     schema.TypeString,
				Required: true,
			},
		},
	}
}

func resourceKongKeyAuthCredentialCreate(d *schema.ResourceData, meta interface{}) error {
	sling := meta.(*sling.Sling)

	keyAuthCredential := getKeyAuthCredentialFromResourceData(d)
	log.Print("KEY AUTH")
	log.Print(spew.Sdump(keyAuthCredential))

	createdKeyAuthCredential := getKeyAuthCredentialFromResourceData(d)

	response, error := sling.New().BodyJSON(keyAuthCredential).Path("consumers/").Path(keyAuthCredential.Consumer + "/").Post("key-auth/").ReceiveSuccess(createdKeyAuthCredential)
	log.Print("KEY AUTH RESPONSE")
	log.Print(spew.Sdump(response))
	if error != nil {<commit_msg>Remove logs<commit_after>package kong

import (
	"fmt"
	"net/http"

	"github.com/dghubble/sling"
	"github.com/hashicorp/terraform/helper/schema"
)

type KeyAuthCredential struct {
	ID       string `json:"id,omitempty"`
	Key      string `json:"key,omitempty"`
	Consumer string `json:"-"`
}

func resourceKongKeyAuthCredential() *schema.Resource {
	return &schema.Resource{
		Create: resourceKongKeyAuthCredentialCreate,
		Read:   resourceKongKeyAuthCredentialRead,
		Update: resourceKongKeyAuthCredentialUpdate,
		Delete: resourceKongKeyAuthCredentialDelete,

		Schema: map[string]*schema.Schema{
			"id": &schema.Schema{
				Type:     schema.TypeString,
				Computed: true,
			},

			"key": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				Description: "The key to use in the Key Authentication.",
			},

			"consumer": &schema.Schema{
				Type:     schema.TypeString,
				Required: true,
			},
		},
	}
}

func resourceKongKeyAuthCredentialCreate(d *schema.ResourceData, meta interface{}) error {
	sling := meta.(*sling.Sling)

	keyAuthCredential := getKeyAuthCredentialFromResourceData(d)

	createdKeyAuthCredential := getKeyAuthCredentialFromResourceData(d)

	response, error := sling.New().BodyJSON(keyAuthCredential).Path("consumers/").Path(keyAuthCredential.Consumer + "/").Post("key-auth/").ReceiveSuccess(createdKeyAuthCredential)
	if error != nil {
{'fraction_non_alphanumeric': 0.126612355736592, 'fraction_numerical': 0.0, 'mean_word_length': 4.667307692307692, 'pattern_counts': {'":': 6, '<': 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': '5101464', 'n_tokens_mistral': 1056, 'n_tokens_neox': 961, 'n_words': 170}